<div class="codetitle"> <span><a style="CURSOR: pointer" data="2061" class="copybut" id="copybut2061" onclick="doCopy('code2061')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code2061"> <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>$(document).ready(function () { <BR>$('#Button1').click(function () { <BR>$('#img1').show(5000); <BR>}); <BR>$('#Button2').click(function () { <BR>$('#img1').hide(5000); <BR>}) <BR>$('#Button3').click(function () { <BR>$('#img1').fadeIn(2000); <BR>}) <BR>$('#Button4').click(function () { <BR>$('#img1').fadeOut(1000); <BR>}) <BR>}) <BR></script> <br> <br> <br><img id="img1" src="images/1.jpg" alt="jQuery图片的展开和收缩实现代码_jquery" > <br><input id="Button1" type="button" value="展开图片"> <br><input id="Button2" type="button" value="收缩图片"> <br><input id="Button3" type="button" value="图片"> <br><input id="Button4" type="button" value="图片1"> <br> <br> <br> </div>