定制手风琴 - 使用每个
我正在尝试为我的页面创建一个自定义手风琴来显示我的帖子。 我使用 HTML 将其以列表格式保存,并且当您单击每个标题以展开以显示更多信息时,我尝试创建效果。
但我不想为页面上的六个
元素设置六个代码块。有没有办法通过 .each(); 运行它 也许? 而不是创建每个部分? 尝试更动态的方法。
I am trying to create a custom accordion for my page to that display my posts. I have it in list format using HTML and I am trying to create an effect when you click each header to expand to show more information.
But I don't want to have say six blocks of code for six of the <li>
elements I have on the page.
Is there a way to run it through .each(); perhaps? Instead of creating each section? Try a more dynamic approach.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您看过本教程吗?
因为,正如这个示例所示,不需要多个条件即可实现这一目标。
Did you take a look at this tutorial ?
Because, as this example illustrates, one does not need multiple conditions to achieve this.
检查这个也很简单
演示: http://demos.pankaj.pro/ jquery-tutorial-guide-to-build-a-simple-accordion/
代码
http://time2hack .com/2013/01/jquery-tutorial-guide-to-build-a-custom-and-simple-accordion.html
Check this also pretty simple
Demo : http://demos.pankaj.pro/jquery-tutorial-guide-to-build-a-simple-accordion/
code
http://time2hack.com/2013/01/jquery-tutorial-guide-to-build-a-custom-and-simple-accordion.html