The problem: When you have mouseover and mouseout events bound to some element on you page with children elements. Hovering over children element fires parent’s mouseover and/or mouseout event. The solution:
Daily Archives: September 3, 2010
Jquery Multiple mouseover
<script type=”text/javascript”> function showImg() { $(“img”, this).fadeIn(200); } function hideImg() { $(this).fadeOut(200); } $(function(){ $(“.reveal img”).mouseenter(hideImg()); $(“.reveal img”).mouseleave(showImg()); </script> <div>foo<img src=”img/water.png” /></div> <div>bar<img src=”img/eye.png” /></div>
How To Optimize Your Site With GZIP Compression .htaccess
Setting up the server The “good news” is that we can’t control the browser. It either sends the Accept-encoding: gzip, deflate header or it doesn’t. Our job is to configure the server so it returns zipped content if the browser can handle it, saving bandwidth for everyone (and giving us a happy user).