开发者

jQuery Mouseover if statement inside of hover statement

Can someone please look at my code and tell me where I am going wrong?

$("div.inner").hover(function(){
    $("span.arrowL, span.arrowR").fadeIn("slow");
    if ($('div#move_next').mouseover()){
      return false; 
    } else {
      return true;
    }
  },
  function(){
    $("span.arrowL, span.arrowR").fadeOut();
  });
});

I am trying to get background images to fade in on a hover and if someone hovers over a certain area I want the arrows to stay there instead of fad开发者_如何学Goe out.


Thinking that once hovering over the arrowL or arrowR elements the hover for the overall parent container is no more and the fade out is called.


Try this:

$('#move_prev').mouseover(function() {
    $('span.arrowL').stop(true).css('opacity', 1);
});

$('#move_next').mouseover(function() {
    $('span.arrowR').stop(true).css('opacity', 1);
});

This should stop the fade-out from happening on the arrow the user's mouse pointer moves over and reverse that part of the fade-out has already been done. This is necessary because #move_prev and #move_next are not inside div.inner, so that's why the arrows hide.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜