Home › Forums › JavaScript › Organic Tabs (Link to a specific tab)
- This topic is empty.
-
AuthorPosts
-
July 14, 2010 at 10:17 am #29617AndrewChampParticipant
Hello, I wanted to know how, if possible, to link to direct tab so that it’ll be highlighted. Any solutions?
I already tried "http://mysite.com/index.php#tabtwo" and it doesn’t work.
Thanks ahead of time.
July 19, 2010 at 10:06 am #79949dcp3450Participantnot quite sure what you mean. need to give more information and/or example.
July 19, 2010 at 11:27 am #79953AndrewChampParticipant"dcp3450" wrote:not quite sure what you mean. need to give more information and/or example.If I have the Organic Tab code on http://mysite.com/index.php (for example) I’d like to be able to go directly to a tab (say #3) w/o having to see the 1st tab & manually clicking #3. I want to have a link that will have the 3rd tab highlighted (ie: http://mysite.com/index.php#tabthree)… but that doesn’t work. I’ve seen other tab codes work like that, but this won’t work. Anyother way to get it to work? Thank you.
July 19, 2010 at 2:55 pm #79974dcp3450Participantusing an address like:
http://mysite.com/index.php#tabtwois referencing and anchor. someone using "http://mysite.com/index.php#tabtwo" has "<a name="tabtwo"></a>" in their code where the div or text for tabtwo is located. try putting <a name="tabtwo"></a> where you have "tabtwo" and then place the #tabtwo in your address.
I use this on my companies site so a user can jump to a specific news store based on id number.
i have a link:
<a href="/news/index.html#135">Title of news story</a>on the news page i have different stories with <a name="(number)"></a>. When the user selects the link it goes directly to the news story number selected even though the link was on a different page.
July 19, 2010 at 3:07 pm #79991AndrewChampParticipant"dcp3450" wrote:using an address like:
http://mysite.com/index.php#tabtwois referencing and anchor. someone using "http://mysite.com/index.php#tabtwo" has "<a name="tabtwo"></a>" in their code where the div or text for tabtwo is located. try putting <a name="tabtwo"></a> where you have "tabtwo" and then place the #tabtwo in your address.
I use this on my companies site so a user can jump to a specific news store based on id number.
i have a link:
<a href="/news/index.html#135">Title of news story</a>on the news page i have different stories with <a name="(number)"></a>. When the user selects the link it goes directly to the news story number selected even though the link was on a different page.
I know what it is. What I’m saying is that for the "Organic Tabs" script, it won’t work that way and I need a way to link to those tabs.
Any ideas?February 9, 2011 at 1:52 am #61973curroqndMemberHi Andrew.
Did you manage to find a solution for this? I’m facing the same problem and I’m totally stuck.
Cheers.
C.
May 4, 2011 at 6:39 am #47458cwulffMemberYeah, I’m stuck on this too. Any thoughts on how to proceed?
January 5, 2012 at 6:39 pm #94074moabxj01MemberA quick and dirty “fix”:
(function(){
var hash = window.location.hash;
var $a = jQuery('a[href=' + hash + ']');
if($a.length>0){
$a.click();
}
})();
Place this below $(“example-one”).organicTabs(); and it should work…modifying the plugin directly would be better though.
October 11, 2016 at 6:25 pm #246427jrodivasupremeParticipantI have the links on another page as:
about-us.2.htm#core
and added the code you mentioned:
(function(){
var hash = window.location.hash;
var $a = jQuery(‘a[href=’ + hash + ‘]’);
if($a.length>0){
$a.click();
}
})();
Below the line :
$(“example-one”).organicTabs();
=========================
and this worked!!!!
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.