<div class="codetitle"> <span><a style="CURSOR: pointer" data="2793" class="copybut" id="copybut2793" onclick="doCopy('code2793')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code2793"> <br> <br> <br><title></title> <br><style type="text/css"> <BR>#img1 <BR>{ <BR>width:400px; <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>$(function () { <BR>$('#Button1').click(function () { <BR>$('#img1').show(5000); //图片的展开 <BR>}) <BR>$('#Button2').click(function () { <BR>$('#img1').hide(5000); //图片的伸缩 <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> <br> <br> </div>