<head> <title></title> <script src="jquery.js" type="text/javascript"></script> <style> #d1 { height: 200px; width: 300px; position: relative; background-color: Red; z-index: 3; } #d2 { height: 50px; width: 50px; position: relative; background-color: green; top: 0px; left: 35px; z-index: 5; } </style> <script type="text/javascript"> $(document).ready(function () { $("#d2").hide(); }); $(document).ready(function () { $("#d1").hover(function () { $("#d2").show(); $("#d2").css("color", "yellow"); for (var i = 1; i <= 100; i++) { var j = (-1) * i; $("#d2").css("background-color", "yellow"); $("#d2").css("top", j.toString() + "px"); } }, function () { $("#d2").hide(); $("#d2").css("top", "0px"); $("#d2").css("background-color", "green"); }); }); </script> </head> <body> <div style="background-color: Orange; width: 500px;"> <div id="d1"> </div> <div id="d2"> test </div> </div> </body> </html>
.addClass()
.removeClass()
.css()
.animate()
.stop()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)