PDA

View Full Version : Tab content target 2 different boxes



sjbohlman
08-15-2008, 01:58 PM
1) Script Title: Tab Content Script (v 2.2) - Demo 2

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

3) Describe problem: I'm working with the code in Demo 2 - and what I want to try to do is as follows:

My Reference Link: http://www.groupjdesign.com/tabs3.html

When you click on tabs Home, Giving Programs, Leave A Legacy or Make a Gift, I want the content of them to appear in the green box that is below the tabs, but when you click on the tabs to the right - Events, Home, Home, I want their content to appear in the box that is below those tabs - while keeping the content in the box to the left consistent with whatever the information from the last tab that was clicked from that side.

Thanks so much in advance!! :)

ddadmin
08-15-2008, 07:23 PM
Well, firstly, this script supports multiple instances of Tabs Content script on the same page, so you should remove the duplicate tabcontent2.js reference in the head section of your page. Then, from what I understand what you're trying to do, you'd simply define two separate instances of Tabs Content script, one for each of the left and right instances.

Now, regarding this part, you'll have to elaborate what you mean:


while keeping the content in the box to the left consistent with whatever the information from the last tab that was clicked from that side.

sjbohlman
08-18-2008, 01:46 PM
Thanks!

Where would I go to define the two separate instances of Tab Content? Is that in the CSS code, or the js code?

What I meant by

while keeping the content in the box to the left consistent with whatever the information from the last tab that was clicked from that side.
Is - (when you click on a link on the left, and the information comes up in the left box), when you click something on the right, and information comes up in the right box - the information that was up from the link in the left box, stays there, and does not go away when a link on the right is clicked.

Thanks again for your help! :)

ddadmin
08-20-2008, 02:50 AM
Actually, the sample HTML code you cut and paste (Step 2 on the script page) by default contains 3 separate instances of Tab Content script, so simply follow the convention laid out there. Mainly, variable names for each instance when initializing them must be unique:


var countries=new ddtabcontent("countrytabs")