/ Published in: JavaScript

this is the way for toggling something on mouse hover in and out
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// HELL YA $('.unit').hover(function (e) { var isIn = e.type === 'mouseenter', $this = $(this); $this.toggleClass('unit-hover',isIn); $this.find('.thumb a') .children('.thumb_BW').toggleClass('hidden',isIn) .end() . children('.thumb_C').toggleClass('hidden',!isIn); $this.children('.arrow-details').toggleClass('hidden',!isIn); });
Comments
