[英]Slider Menu Open Close Issues/ Jquery
How are you. 你好吗。 I'm building a content menu/accordion and I was having some trouble building out 3 segment of it. 我正在构建内容菜单/手风琴,但在构建它的3个部分时遇到了一些麻烦。
1) Wanted When you click on button, to keep the previous menu open, menu should be closed manually and not automatically. 1)想要当您单击按钮时,要保持上一个菜单处于打开状态,应手动而非自动关闭菜单。 Currently it automatically closes the previous. 当前它会自动关闭前一个。
2) A close All click link that closes all the menu 2)关闭所有点击链接以关闭所有菜单
3) a Open all click link that opens all the menu 3)打开所有点击链接可打开所有菜单
i Started a Fiddle 我开始了小提琴
http://jsfiddle.net/XUEFx/1/ http://jsfiddle.net/XUEFx/1/
$('div.accordionButton').click(function() {
$('div.accordionContent').slideUp('normal');
$(this).next().slideDown('normal');
});
/*********
CLOSES ALL DIVS ON PAGE LOAD
*****/
$("div.accordionContent").hide();
Looks like you just give a job. 看起来您刚刚找到工作。 I mean that you actually do not know html/js well. 我的意思是您实际上不太了解html / js。
$('div.accordionButton').click(function() {
$(this).next().slideToggle('normal');
});
$('#hide-all').on('click',function(){
$('div.accordionContent').slideUp('normal');
});
$('#show-all').on('click',function(){
$('div.accordionContent').slideDown('normal');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.