English 中文(简体)
hoverIntent + near button (problem with timeout?)
原标题:hoverIntent + close button (problem with timeout?)

I m 采用有购物袋的内冲器(#bagContainer)和一切都使用K。

function bagOver(){
    $(this).find("#bagContainer").stop().fadeTo( fast , 1).show(); 
}
function bagOut(){
  $(this).find("#bagContainer").stop().fadeTo( fast , 0, function() {
      $(this).hide();
  });
}
var bagHoverConfig = {
     over: bagOver,
     bagTimeout: 3000, 
     out: bagOut 
};
$("#userBox .row:nth-child(2)").hoverIntent(bagHoverConfig);

But I need to add an "extra" close button (#bagCollapser) inside the bag, something like:

$("#bagCollapser").click(function () {
    $( #bagContainer ).hide();
});

It closes #bagContainer, but it seems there is a conflict with hoverIntent:

  1. the button hides the bag, but then, after bagTimeout , hoverIntent hides it again
  2. if the bag has been closed via the button, it can t be shown again until hoverIntent s timeout/delay has passed...

Any ideas?

预祝福!

问题回答

I ve got the same issue, I m using hoverIntent to display a megamenu. Inside this megamenu I ve created a close button :

$("#closebutton").click(function () {
  $( #megasubmenu ).hide();
  $( #megasubmenu ).closest( li.level0 ).find( a.level0 ).removeClass("megahover");
});

The close button closes the submenu but the hoverIntent function is still running because as soon as there is a mouse move the submenu reappears...





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签