Mouseover/out play/pause
Mouseover/out play/pause
Hey everybody,
This is my first post and I'm currently working 2 days with Jquery so i'm very noob at it 
I use this script to display and external rss feed into a news ticker (which works just fine).
but,
My question is... Can I make a function so the newsticker pauses when you mouseover it and plays along when you mouseout? I know these functions exists and there is a lot of documentation about it but i just can't seem to get it working in my script. Can someone provide me a working code please, that would save me a lot of time!
- <script type="text/javascript">
- $(document).ready(function(){
- var nieuwstickerfirst = 0;
- var nieuwstickerspeed = 250;
- var nieuwstickerpause = 3000;
-
- function nieuwstickerremoveFirst(){
- nieuwstickerfirst = $('.nieuwsticker ul.nobullets li:first').html();
- $('.nieuwsticker ul.nobullets li:first')
- .animate({opacity: 0}, nieuwstickerspeed)
- .fadeOut('slow', function() {$(this).remove();});
- nieuwstickeraddLast(nieuwstickerfirst);
- }
-
- function nieuwstickeraddLast(nieuwstickerfirst){
- nieuwstickerlast = '<li style="display:none">'+nieuwstickerfirst+'</li>';
- $('.nieuwsticker ul.nobullets').append(nieuwstickerlast)
- $('.nieuwsticker ul.nobullets li:last')
- .animate({opacity: 1}, nieuwstickerspeed)
- .fadeIn('slow')
- }
- nieuwstickerinterval = setInterval(nieuwstickerremoveFirst, nieuwstickerpause);
- });
- </script>
Thanks in advance!
ps: Jquery rocks! wish i knew it better