I recently have been playing around with a "Desktop" module that was
on nettuts and made a modification for it that doesn't fully work.
There are many draggable windows, and in order for them to function
like a real desktop they need to have z-index changes such that if you
close one on top the last one you had on top is right below it.

I believe my error comes in with "this" or possibly something else,
but when you pull one to the front it causes some or all of the others
to end up in the same z-index causing them to not stay in order of
recently viewed.

        jQuery('.draggableWindow').mousedown(function(){
                numWindows=jQuery('.draggableWindow').size() + 500;//the + 500 
is to
make sure they are above other objects on the page
                zindexIt2 = parseInt($(this).css("z-index"));
                if(zindexIt2 < numWindows){
                        $(this).css("z-index",numWindows);//brings to front
                        $('.draggableWindow').each(function(){//supposed to 
drop others
back one...
                        newZ2=$(this).css("z-index");
                        if(newZ2 > zindexIt2){
                                newZ2--;
                                $(this).css("z-index",newZ2);
                        }
                        });
                }
        });

Reply via email to