[ 2 posts ]

Joe Ponczak

  • Username: pojo
  • Joined: Thu Jun 30, 2011 3:33 am
  • Posts: 1
  • Offline
  • Profile

Linking between YUI Tabs

Post Posted: Thu Jun 30, 2011 4:28 am
+0-
Hello,
I am new to YUI and am looking for some tips on linking content between tabs? So, for example, if I have 3 tabs, I would like to link from content within Tab 1 to a specific content anchor in Tab 3, and vice versa. Any ideas?

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 358
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile
Tags:

Re: Linking between YUI Tabs

Post Posted: Tue Jul 05, 2011 7:11 am
+0-
Attach a click handler to the link in Tab 1 which first shows tab 3 and then scrolls to the anchor. Assuming YUI 3:

YUI().use('tabview', 'gallery-scrollintoview', function(Y)
{
var tabview = new Y.TabView(...);
Y.on('click', function()
{
tabview.selectChild(2);
Y.one('#anchor-in-tab-3').scrollIntoView();
},
'#link-in-tab1');
});
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum