2011-05-09 40 views

回答

1

剛閱讀下面的代碼

<html> 
<head> 

<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript"> 
$(document).ready(function(){ 
$(".flip").click(function(){ 
    $(".panel").slideToggle("slow"); 
    }); 
}); 
</script> 

<style type="text/css"> 
div.panel,p.flip 
{ 
margin:0px; 
padding:5px; 
text-align:center; 
background:#e5eecc; 
border:solid 1px #c3c3c3; 
} 
div.panel 
{ 
height:120px; 
display:none; 
} 
</style> 
</head> 

<body> 

<div class="panel"> 
<p>Because time is valuable, value the time</p> 
<p>time is money, Money is time .</p> 
</div> 

<p class="flip">Show/Hide Panel</p> 

</body> 
</html> 

希望這將有助於採取幫助從它

+0

感謝這個,2個問題雖然。我怎樣才能更新這段代碼,使它從底部向上而不是從頂部向下滑動?還有我怎麼能更新切換,以便當你點擊顯示文本然後改變隱藏,反之亦然? – styler 2011-05-09 09:39:05