Hi Tia, the onEnd callback is called before scriptaculous reactivate original CSS value. so that is normal :))
Open Firebug, and have the HTML 'test' element visible inside it to see change in thge z-index value, do this first test: <div id="test" style="position:absolute;z-index:50;width:500px;height: 300px;background-color:#cccccc"> move me !!! </div> <script> new Draggable('test',{onEnd:testFunction}); function testFunction(){ alert('before'); $('test').setStyle({ zIndex:'52' }); alert('after'); } </script> this test is with your problem. By defering the execution of the setStyle method, the problem is resolved. try now: <div id="test" style="position:absolute;z-index:50;width:500px;height: 300px;background-color:#cccccc"> move me !!! </div> <script> new Draggable('test',{onEnd:function(){testFunction.defer();}}) function testFunction(){ alert('before'); $('test').setStyle({ zIndex:'52' }); alert('after'); } </script> It should work as expected. -- david On 11 mar, 11:29, ColinFine <colin.f...@pace.com> wrote: > On Mar 10, 12:15 pm, Wouter Immerzeel <wou...@tweed.nl> wrote: > > > hey hi.... > > > I have an element which I wat to be on top (zIndex) after drag. > > > but if I try f.i > > > new Draggable(mydiv,{onEnd: function() { > > $(mydiv).addClassName('whatever'); > > $(mydiv).setStyle({ zIndex:'52' }); > > } > > }); > > > The classname gets set, but the Z-index gets returned to the original > > value it has in my stylesheet. (50 in my case) > > > Why doesn't this work? > > Just a guess, but I wonder if there's anything in there that's going > to convert '52' to the number 52? > > Colin > > > Tia > > Wouter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---