Try this.
$("#menu li:not(.selected)").animate({
marginLeft: "-200px"
}, function() {
if ($(this).is(':last')) {
$("#menu").hide();
}
});
On Wed, Aug 5, 2009 at 12:15, Mathieu wrote:
>
> Thanks for your answer Leonardo.
>
> The callback is not called once.
>
> $("#menu li:n
Thanks for your answer Leonardo.
The callback is not called once.
$("#menu li:not(.selected)").animate({
marginLeft: "-200px"
}, function() {
$("#menu").hide();
alert("Hello");
});
Hello gets printed many times.
--
Mathieu
On Aug 5, 3:29 pm, Leonardo K wrote:
> Use th
Use the callback function
$("#menu li").click(function() {
// toggle selected item in list
$(this).toggleClass("selected");
// animate all other LI elements to disappear (sliding left)
$("#menu li:not(.selected)").animate({
marginLeft: "-200px"
}, function(){
$(
3 matches
Mail list logo