我對我們論壇的用戶簽名顯示/隱藏腳本,jQuery的多個顯示隱藏問題
的代碼是這樣的:
<fieldset>
<legend align="right"><a href="member.php?$session[sessionurl]u=$post[userid]">Signature of $post[musername] </a></legend>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("a").click(function(){
$("signature").toggle(600);
(this).parent().prev('.toggle').toggle('slow');
});
});
</script>
<div class="spoiler" align="center">
<font size="2" face="Tahoma"> <a style="cursor:pointer">Press here to see $post[musername]'s signature</a>
</if></font></div></div><br>
<signature style="display: none;" align="center">$post[signature]</signature>
</fieldset>
代碼工作很好,但是當一個按隱藏/顯示文字,所有簽名顯示哪些是令人煩惱的。有任何想法嗎?
我試過http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_toggle 上的代碼,並將代碼加倍(鍵入了兩次),所有簽名同時出現/消失!
代碼是做什麼的,你期望什麼? – 2014-11-22 12:10:49