17th of December 2010 0
Hi all, im struggling to move a simple panel 400px to the right, and then 400px to the left. this is what i got so far:
var getWidth = $ (‘#toolbarHolder’).width() – 40;
$ (‘.btn-opentoolbar’).click(function() {
$ (‘#toolbarHolder’).animate({left: -getWidth}, 500);
return false;
});
It doesnt work though and if it works it only moves 1 direction and not to original position again on next mouse click.
I hope someone can help me
Thanks in advance
Mark
Best answer:
Answer by Mr. Bex
hi!
al you have to do is to add a toggle action, and add inside the animate action:
$ (“#tmenu”).toggle(function(){$ (‘#sbcont’).animate({left: -getWidth}, 0);}, function(){$ (‘#sbcont’).animate({left: +getWidth}, 0);});
});
for more information take a look in the API of jquery =P
good luck
What do you think? Answer below!
No sponsors at the moment.
Copyright jqueryui.info since 2010. All rights reserved. Design and the Absolute Theme by Tommie Hansen.