Using if else with mouseover

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:

  1. $(document).ready(function() {
  2. window.setInterval(function() { //Every 3 seconds do this function
  3. if ("a.focus").mouseover(function() {
  4. //Do nothing
  5. }) else {
  6. $(".list li:nth-child(3)").children().toggleClass('focus'); //Remove class from <li> #3
  7. $(".list li:last").css("height", 0);
  8. $(".list li:last").prependTo(".list").animate({ //Put last <li> to the top of the list and animate the height from 0 to 48
  9. height: 48,
  10. },200, function(){
  11. //Animation Complete
  12. });
  13. $(".list li:nth-child(3)").stop().children().toggleClass('focus'); //Add class to <li> #3
  14. }
  15. }, 3000);
  16. });
Any help would be appreciated,
Thanks
Ralph :)