PDA

View Full Version : Trying to use same tab content scripts on same page



media
12-24-2007, 07:44 AM
Trying to use same tab content scripts

http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

on same page more than 3 times but with diffrent shade.gif and shadeactive.gif ....

How can i do this with a minimum code...

I need to change only these two values:

.shadetabs li a{
background: white url(images/shade.gif) top left repeat-x;
}

.shadetabs li a.selected{ /*selected main tab style */
background-image: url("images/shadeactive.gif");
border-bottom-color: white;
}

How can i do this???

Thank you for your help... :)

Medyman
12-24-2007, 03:25 PM
1) change the name of the classes


.shadetabs2 li a{
background: white url(images/shade.gif) top left repeat-x;
}

.shadetabs2 li a.selected{ /*selected main tab style */
background-image: url("images/shadeactive.gif");
border-bottom-color: white;
}

and now refer to these new class names within your html. so you'll have 3 codies of the same coding essentially, with different color schemes.


2) Use multiple classes


.shadetabs li a{
background: white url(images/shade.gif) top left repeat-x;
}

.shadetabs li a.selected{ /*selected main tab style */
background-image: url("images/shadeactive.gif");
border-bottom-color: white;

.tab2 a { backround:url(inactiveimage.2) }
.tab2 a.selected { bacgkround:url(active.2) }
.tab3 a { background:url(inactiveimage.3) }
.tab3 a.selected { background:url(active.3) }
}

Now, in the corrsepoding element, add:


<class='shadetabs tab2'>

media
12-24-2007, 05:56 PM
I could not get the second one (number 2) but first one (number 1) works like a charm....

Thank you for your help....

You rock man... :)

media
01-10-2008, 03:03 AM
Hello,
I have another question, I start using same tab content js file and css file for three diffrent paleces on my page, but whenever i go to next or previous page and when i come back to same page content goes back to first tab.... Even i click a link on the 5th tab but the script takes me to the first tab when i come back...

Is there anything that i can do to get rid of this?

Thanks

ddadmin
01-11-2008, 11:36 AM
Have you enabled persistence in the script? Please post a link to the page on your site that contains the problematic script so we can check it out.

media
01-11-2008, 10:15 PM
If you are talking about this:

this.enabletabpersistence=true

Yes i did...

Thank you

ddadmin
01-11-2008, 11:39 PM
Hi:
Are you saying the tabs themselves reset to the first tab when you navigate to another page then back? In other words, the persistence feature isn't working? It seems to be for me, at least in FF2.x.

BTW, please note that your page is currently in violation of our usage terms, since the credit notice doesn't appear inline on the page. Please reinstate the credit notice: http://www.dynamicdrive.com/notice.htm

media
01-12-2008, 01:09 AM
I am sorry i did not even realize that, I reinstated the credit...


Anyway, i am on the ie and it is not working at all...

What should i do to deal with this and correct the problem?

Thanks for your help...


Hi:
Are you saying the tabs themselves reset to the first tab when you navigate to another page then back?

Yes but it is not working at all...

Please help...

media
01-12-2008, 03:22 AM
I did some testing and see that firefox is working but my ie is not working but at the same time my lap top has same version ie and it is working on that one...

This is so weird...