7
这是我用来隐藏和显示幻灯片切换效果的div的代码。如何切换下拉箭头
jQuery(document).ready(function() {
jQuery(".option-content").hide();
jQuery(".option-heading").click(function()
{
jQuery(this).next(".option-content").slideToggle(500);
});
});
但是我想添加一些切换的箭头来显示切换的div是向上还是向下。
这是我有这么远,它的什么,我想它的一半做:
jQuery(document).ready(function() {
jQuery(".option-content").hide();
jQuery("#arrow-up").hide();
jQuery(".option-heading").click(function()
{
jQuery(this).next(".option-content").slideToggle(500);
jQuery("#arrow-up").toggle();
jQuery("#arrow-down").toggle();
});
});
这将触发箭头,但有两个问题:
- 向下箭头显示停留
- 每个div都会切换每个箭头,因此当某个div启动并且一个div被关闭时,它们全都显示为down。
任何想法,将appriciated