简体   繁体   中英

jQuery Rollover

I'm simply hiding and showing a products descrption on rollover, can it be done better then this?

Its a little buggy when the mouse goes in and out

$("a.roll-over-trigger").hover(
   function() {
      $(this).next('.altProduct p').slideDown('300');
   },
   function() {
      $(this).next('.altProduct p').slideUp('300');
   }
);

a.roll-over-trigger is the image itself

and .altProduct p slides up over half of the image when hovered.

Here's a link http://tinyurl.com/d8dxd47

Thanks

You didn't provide any example, just a guess

$("a.roll-over-trigger").on('hover', function(e) {
    $(this).next('.altProduct').find('p').slideToggle('medium');
});

An example here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM