<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%20" 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> <br><input id="Button1" type="button" value="展開圖片"> <br><input id="Button2" type="button" value="收縮圖"> <br> <br> <br> </div>