简体   繁体   English

从外部页面链接到特定的jQuery选项卡

[英]Linking to specific jquery tab from external page

I am using a jquery script called Feature List for displaying different sections of info on a page. 我正在使用一个名为Feature List的jquery脚本在页面上显示信息的不同部分。 The user can click through the various tabs to see different content. 用户可以单击各个选项卡以查看不同的内容。 It works great for what I want it to do but I was hoping to be able to link to each tab from an external page. 它非常适合我想要的功能,但是我希望能够从外部页面链接到每个选项卡。 The problem is I'm not great with jquery am not sure how to go about this or if it's possible with the way the page is set up. 问题是我对jquery不太满意,不确定该怎么办,或者页面设置方式是否可行。

You can see the page and view the source at http://nourishedbynature.co.uk/ 您可以在http://nourishedbynature.co.uk/上看到该页面并查看源代码。

Ideally I'd like to be able to link to the page and display a specific tab by appending something the the url. 理想情况下,我希望能够链接到页面并通过在URL后面附加一些内容来显示特定的标签。

Any ideas would be greatly appreciated. 任何想法将不胜感激。

Thanks 谢谢

Use document.location.hash on $.ready then fire the jQuery code that corresponds to that hash. 在$ .ready上使用document.location.hash,然后触发与该哈希对应的jQuery代码。

$.ready(function(){
    gotosectionforhash(document.location.hash);
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM