Using if else with mouseover
Hi there,
I'm trying to stop my script running if someone mouses over a link with the class .focus. I'm probably trying to do something really stupid but I can't quite work out what.
The code:
- $(document).ready(function() {
- window.setInterval(function() { //Every 3 seconds do this function
- if ("a.focus").mouseover(function() {
- //Do nothing
- }) else {
- $(".list li:nth-child(3)").children().toggleClass('focus'); //Remove class from <li> #3
- $(".list li:last").css("height", 0);
- $(".list li:last").prependTo(".list").animate({ //Put last <li> to the top of the list and animate the height from 0 to 48
- height: 48,
- },200, function(){
- //Animation Complete
- });
- $(".list li:nth-child(3)").stop().children().toggleClass('focus'); //Add class to <li> #3
- }
- }, 3000);
- });
Any help would be appreciated,
Thanks
Ralph :)