LeMisterV / jquery.hoverintent

jQuery plugin that implements two new events : mouseenterintent and mouseleaveintent
18 stars 1 forks source link

Help with featured image / thumbnail switch #4

Open rickydazla opened 12 years ago

rickydazla commented 12 years ago

Hey there, I have the following I wrote to switch a featured product image on mouseover:

    $('.thumbnail').live('click mouseenterintent', function () {
      $('.featured img').prop('src',$(this).prop('src').replace('small','big'));
      return false;
    });

mouseenterintent does not seem to work here like mouseover does... what am I doing wrong?

LeMisterV commented 12 years ago

Hi,

I can't look at this right now, but I think it's not possible to use events "mouseenterintent" or "mouseleaveintent" with .live(). Thoses events are not natural DOM events, but special events. I think thoses special events won't bubble like natural DOM events do. So it's not possible to delegate ( .live() ) thoses special events (same problem as focus or blur events).

I'll look at this deeper as soon as I can, and I hope I'll be able to make a new version of jQuery.hoverIntent with bubling events soon (or compatible with event delegation).

Thanks for your feedback, and sorry for this issue.

Nico