可能重複:
Modify Jquery functionality for divs需要jQuery的修改現有展開摺疊功能
已經有一個expandAll/collpaseAll所有div代碼。 http://www.adipalaz.com/experiments/jquery/expand.html。如果向下滾動,您將能夠看到文件/代碼。
我最近2天以來想要的是在所有div的底部獲得[ExpandAll/CollpaseAll]的另一個鏈接(現在只有1個鏈接位於所有div的頂部)。
<script type="text/javascript">
$(function() {
// --- Using the default options:
$("h2.expand").toggler();
// --- Other options:
//$("h2.expand").toggler({method: "toggle", speed: 0});
//$("h2.expand").toggler({method: "toggle"});
//$("h2.expand").toggler({speed: "fast"});
//$("h2.expand").toggler({method: "fadeToggle"});
//$("h2.expand").toggler({method: "slideFadeToggle"});
$("#content").expandAll({trigger: "h2.expand", ref: "div.demo", localLinks: "p.top a"});
});
</script>
<body>
<div id="wrapper" class="demo">
<h3 class="expand"> Number 1</h3><div class="collapse">
<table><tr><td> I am number one</td></tr></table></div>
<h3 class="expand"> Number 2</h3><div class="collapse">
<table><tr><td> I am number two</td></tr></table></div>
</div></body>
請不要發佈重複的問題:[http://stackoverflow.com/questions/6871993/modify-jquery-functionality-for-divs](http://stackoverflow.com/questions/6871993 /修改 - jquery的官能換的div) – Sparky