scssqly轩 2009-11-04
代码如下:
<head> <title>toggle()</title> <style type="text/css"> <!-- body{ background:url(bg.jpg); margin:20px; padding:0px; } img{ border:1px solid #FFFFFF; } --> </style> <script language="javascript" src="jquery.min.js"></script> <script language="javascript"> $(function(){ $("img").toggle( function(oEvent){ $(oEvent.target).css("opacity","0.5"); }, function(oEvent){ $(oEvent.target).css("opacity","1.0"); } ); }); </script> </head> <body> <img src="test.jpg"> </body>