【发布时间】:2010-03-31 20:21:48
【问题描述】:
如何在启动时默认关闭手风琴。这是示例视图here
代码如下:
<script>
$(function() {
$("#accordion").tabs("#accordion div.pane", {tabs: 'h3', effect: 'slide'});
});
</script>
<script>
// add new effect to the tabs
$.tools.tabs.addEffect("slide", function(i, done) {
// 1. upon hiding, the active pane has a ruby background color
this.getPanes().slideUp("slow").css({backgroundColor: "#fff"});
// 2. after a pane is revealed, its background is set to its original color (transparent)
this.getPanes().eq(i).slideDown("slow", function() {
$(this).css({backgroundColor: 'transparent'});
// the supplied callback must be called after the effect has finished its job
done.call();
});
});
</script>
【问题讨论】:
-
顺便说一句,这里有一个 jQuery UI Accordion,它是
.accordion()jqueryui.com/demos/accordion 可能想澄清一下您实际上是在使用问题中的标签小部件:) -
我没有使用我重新发布的小部件以及我正在关注的示例链接
标签: javascript jquery jquery-plugins jquery-events