<div class="codetitle"> <span><a style="CURSOR: pointer" data="99848" class="copybut" id="copybut99848" onclick="doCopy('code99848')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code99848"> <br> <br> <br> <br><title></title> <br><style type="text/css"> <BR>#img1 <BR>{ <BR>width: 500px; <BR>height: 400px; <BR>border: solid 1px #ccc; <BR>display:none; <BR>} <BR></style> <br><script src="jquery-1.9.1.js" type="text/javascript"></script> <br><script type="text/javascript"> <BR>var count = 0; <BR>$(function () { <BR>$('#Button1').click(function () { <BR>if (count % 2 != 0) { <BR>$('#img1').hide(5000); <BR>} <BR>else { <BR>$('#img1').show(5000); <BR>} <BR>count++; <BR>}) <BR>}) <BR></script> <br> <br> <br><form id="form1" runat="server"> <br><div> <br><img id="img1" src="images/1.jpg" alt="jQuery使用一个按钮控制图片的伸缩实现思路_jquery" > <br><input id="Button1" type="button" value="点我看看"> <br> </div> <br> </form> <br> <br> <br> </div>