CeiWCJ 2009-11-16
代码如下:
#DivToggle { height: 150px; width: 200px; margin: 50px; background-color: #6CC; }
代码如下:
<script type="text/javascript"> $( function() { $("#btnShow").click(function(event) { $("#DivToggle").toggle(); }); } ); </script>
代码如下:
<script type="text/javascript"> $( function(event) { $("#btnShow").hover(OverOut, OverOut); function OverOut(event) { $("#DivToggle").toggle(600); } } ); </script>
代码如下:
<script type="text/javascript"> $( function(event) { function OverOut(event) { $("#DivToggle").toggle(600); } $("#DivToggle").toggle(function() { $("#btnShow").click(OverOut); }, function() { $("#btnShow").click(OverOut); }); } ); </script>
代码如下:
<script type="text/javascript"> $( function(event) { function OverOut(event) { $("#DivToggle").toggle(600); } $("#DivToggle").toggle(function() { $(this).click(function() { $(this).css("background", "Blue"); }); }, function(event) { $(this).click(function() { $(this).css("background", "Green"); }); }); } ); </script>
代码如下:
<script type="text/javascript"> $( function(event) { function OverOut(event) { $("#DivToggle").toggle(600); } $("#btnShow").toggle( OverOut, OverOut, function() { $("#DivToggle").css({ "background": "Green" }); }, function() { $("#DivToggle").css({ "background": "Blue" }); } ); } ); </script>