开发者

mouseover mouseout not working properly

Am trying show a modal on mouse over and close modal on mouse out. i give class for div and calling it on .hover.

but its like blinking. open close open close.

why this behavior??

even mouse is inside div 开发者_高级运维its closing .

$('.divclass').hover(function(){
  dialog.open()
},
function(){
  dialog.close()
});

i use mouse over and mouseneter .. same behavior like blinking..open close... Why?? any suggesion


I suggest you to try

$('.divclass').mouseenter(function() {
  //dialog open
});

$('.divclass').mouseleave(function() {
  //dialog close
});


In the css specify the dialog box as: pointer-events: none;
This prevents the dialog box from interfering with the hover action.


please try the below code if it works

 $('.divclass').hover(
        function () {
          dialog.open();  
        },
        function () {
            dialog.close();
        }
    );

There is a hoverIntent plugin which is really useful, try if possible

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜