PDA

View Full Version : Tab Content script: Start with a specific tab



guvenck
02-21-2007, 03:10 PM
1) Script Title:
Tab Content Script

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

3) Describe problem:

Hi, I would like to thank DD for this nice script. I am using it with no problems.

I wonder if I can link to a specific tab from another page. In other words, can I make the tab content div start with a specific tab?

For example I keep the Book Info on the first tab and the comments for this book on the 4th tab.

Can I make a link from another page (for ex. Search Results Page) like "Click to read the comments on this book" and load the page with 4th tab selected?

jscheuer1
02-21-2007, 04:07 PM
See:

http://www.dynamicdrive.com/forums/showthread.php?t=12105

mburt
02-21-2007, 04:16 PM
Yep, just add the "selected" class to the <li> element:

<li class="selected"><a href="#default" rel="ajaxcontentarea">Intro</a></li>

jscheuer1
02-21-2007, 04:29 PM
Yep, just add the "selected" class to the <li> element:

<li class="selected"><a href="#default" rel="ajaxcontentarea">Intro</a></li>

How does that, do this:



I wonder if I can link to a specific tab from another page.

Can I make a link from another page (for ex. Search Results Page) like "Click to read the comments on this book" and load the page with 4th tab selected?

mburt
02-21-2007, 04:41 PM
Oops.. I thought the OP was reffering to this script:
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

jscheuer1
02-21-2007, 04:47 PM
Oops.. I thought the OP was reffering to this script:
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

That still wouldn't load a tab from a link on another page with that script. The two scripts are similar and the thread that I linked to in my post:

http://www.dynamicdrive.com/forums/showthread.php?t=12105

covers how to do this for both of them.

guvenck
02-23-2007, 02:03 PM
I posted my humble PHP solution to the original thread. Thanks a lot.