robert_gsfame Posted August 26, 2010 Share Posted August 26, 2010 i got this after googling, n i wish to stop the animation once onmouseover and get the animation back once onmouseout...i can stop it but dont have any idea on how to run it back below is the jquery $(document).ready(function(){ var first = 0; var speed = 100; var pause = 3500; function removeFirst(){ first = $('ul#listticker li:first').html(); $('ul#listticker li:first') .animate({opacity: 100000}, speed) .fadeOut('slow', function() {$(this).remove();}); addLast(first); } function addLast(first){ last = '<li style="display:none">'+first+'</li>'; $('ul#listticker').append(last) $('ul#listticker li:last') .animate({opacity: 1}, speed) .fadeIn('slow') } interval = setInterval(removeFirst, pause); }); function pauseRotateText() { clearInterval(interval); } i use onmouseover=pauseRotateText() to stop the animation...how can i run it back using onmouseout thx in advance Quote Link to comment Share on other sites More sharing options...
Adam Posted August 26, 2010 Share Posted August 26, 2010 Looks like you just need to set the interval again: interval = setInterval(removeFirst, pause); Quote Link to comment Share on other sites More sharing options...
robert_gsfame Posted August 26, 2010 Author Share Posted August 26, 2010 yeup but where should i put that code...i have tried it but not working Quote Link to comment Share on other sites More sharing options...
Adam Posted August 26, 2010 Share Posted August 26, 2010 If you make the "interval" variable global (i.e. declare it outside the jQuery ready function) you should be able to do it anywhere. Quote Link to comment Share on other sites More sharing options...
robert_gsfame Posted August 27, 2010 Author Share Posted August 27, 2010 GREAT!!! it works mrAdam!! Thx a lot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.