jQuery,一页上有多个选项卡组 [英] jQuery, multiple tab groups on one page

查看:98
本文介绍了jQuery,一页上有多个选项卡组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Soh Tanaka提供的简单标签示例. http://www.sohtanaka.com/web-design/simple-tabs-w-css-jquery

I am using a nice simple tab example from Soh Tanaka.http://www.sohtanaka.com/web-design/simple-tabs-w-css-jquery

我试图将多个选项卡组放在同一页面上,但每个选项卡组都使用相同的类.我正在动态创建选项卡的内容,因此为每个选项卡组创建新类都是不可能的.

I am trying to put multiple tab groups on the same page yet use the same classes for each tab group. I am making the content for the tabs dynamically, so making new classes for each tab group is out of the question.

如何为不同的选项卡组使用相同的类,相同的jQuery?我知道jQuery中有可用的.each()方法,但是在尝试找出将其放入jQuery的正确位置时遇到了麻烦.任何帮助是极大的赞赏.

How do I use the same classes, same jQuery for the different tab groups? I know there is the .each() method available in jQuery, but I am having trouble trying to figure out the correct places to put it in the jQuery. Any help is greatly appreciated.

谢谢.

推荐答案

在您链接的博客条目的评论中,有关于此的讨论.他链接到此处的演示: http://www.sohtanaka.com/web-design/examples/tabs/index3.htm

In the comments on the blog entry you linked, there is a discussion about that. He links to a demo here: http://www.sohtanaka.com/web-design/examples/tabs/index3.htm

在该演示中,选项卡的访问方式发生了变化.

In that demo, there is a change in the way tabs are accessed.

$("div[class^='simpleTabs']").simpleTabs(); //Run function on any div with class name of "Simple Tabs"

这是通过将选项卡式部分包装在具有simpleTabs

This is done by wrapping your tabbed sections in a div with a class of simpleTabs

这篇关于jQuery,一页上有多个选项卡组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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