/ Published in: jQuery
For those multiple rollovers - and their multiple flashes! The solution is to stop(!) them.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="../assets/js/jquery.js"></script> <script type="text/javascript"> $(function () { $('#animate').hover(function () { $('.box').stop().fadeTo(200, 1); }, function () { $('.box').stop().fadeTo(200, 0); }); }) </script> </head> <body> <style type="text/css"> .box {width:50px;height:50px;display:block;background:red;margin:20px;border:1px solid #ccc;} </style> <a href="#" id="animate">Animate</a> <div class="box"></div> <div class="box"></div> </body> </html>