同时打开所有手风琴窗口 [英] Open all accordion windows at the same time

查看:73
本文介绍了同时打开所有手风琴窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的应用程序使用jQuery手风琴插件。有没有一种方法可以同时(在页面加载之后)打开各节,以便同时显示所有页面的内容。如果无法实现,请给我一个链接,让我可以实现与该功能相似的功能。
谢谢。
我是jQuery的新手。

I am using jQuery accordion plugin for my application. Is there a way to open sections at the same time(after page has loaded) so that contents of all pages are shown at the same time. If it is not possible please give me a link where I can achieve similar to that functionality. Thanks. I am a newbie to jQuery.

推荐答案

jQuery使得无需插件即可轻松制作自己的手风琴。例如,以下HTML:

jQuery makes it very easy to make your own accordion without a plugin. For example, this HTML:

<div class="accordion_toggler">
    Section One
</div>

<div class="accordion_content">
    ..... content here ......
</div>

和这个jQuery:

$('.accordion_toggler').click(function() {
    $(this).next('.accordion_content').slideToggle();
});

每次单击 accordion_toggler 时,以下 accordion_content 将切换(在这种情况下向上或向下滑动)。要从隐藏所有内容开始但允许同时打开多个内容,请使用以下CSS:

Any time you click on an accordion_toggler , the following accordion_content will toggle (slide up or down in this case). To start with all the content hidden but allow multiple to be open at the same time, use this CSS:

.accordion_content { display: none }

这篇关于同时打开所有手风琴窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆