Hi, my jquery animation is not working, i think the porblem are the dynamic elements.
Is it possible to say live() with animate()?
$(".tls").animate({"left": "-=50px"}, "slow");
kind reagards peter from germany
Hi, my jquery animation is not working, i think the porblem are the dynamic elements.
Is it possible to say live() with animate()?
$(".tls").animate({"left": "-=50px"}, "slow");
kind reagards peter from germany
LiveQuery is pretty good for dealing with dynamic elements.
I assume you have some kind of trigger for the animation?
The code line you supplied will run the animation whenever the code line is reached in the code - what it seems you want, is to bind an animation to an element, and execute it later.
Try, for example,
$('.tls').live('click', function(ev) {
$(this).animate({left: '-=50px'}, 'slow'});
// Add any necessary event handling here, for example
ev.preventDefault();
ev.stopPropagation();
});
How are you making the live call? Maybe you should use delegate instead: http://api.jquery.com/delegate/