jonnyp
02-28-2006, 09:26 AM
DD Script: Tab Content
url:http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
Hello there!
I've installed the tab content script on my charity website - http://www.rectifi.org.uk - and I think it's made the header look an awful lot smarter. Everything seemed to be working, but I've since noticed a bit of a problem.
On each page - whether shopping, searching or ebay - I automatically edit this line of the code to set which tab to display:
var initialtab=[1, "sc1"]
becomes:
var initialtab=[<php
if ($web) echo "1";
if ($shop) echo "2";
if ($ebay) echo "3";?>, "sc1"]
However on a page where it isn't the first tab listed that is the initial tab (ie: http://www.rectifi.org.uk/details/0/SAMSUNG+LE32T51B.html ) it changes the tab to display the correct colour, yet for some reason it always displays the content (a form) of the first tab. If I click to another tab and then back it displays the correct content.
Any ideas why, and what I can do about it?
(I have checked each form is inside the correct div tag)
Additionally, is there anyway I can get the tabs to display before the page loading is complete (I guess this means executing it before the body onload() event?)
Any suggestions would be much appreciated! Many thanks,
Jonny
url:http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
Hello there!
I've installed the tab content script on my charity website - http://www.rectifi.org.uk - and I think it's made the header look an awful lot smarter. Everything seemed to be working, but I've since noticed a bit of a problem.
On each page - whether shopping, searching or ebay - I automatically edit this line of the code to set which tab to display:
var initialtab=[1, "sc1"]
becomes:
var initialtab=[<php
if ($web) echo "1";
if ($shop) echo "2";
if ($ebay) echo "3";?>, "sc1"]
However on a page where it isn't the first tab listed that is the initial tab (ie: http://www.rectifi.org.uk/details/0/SAMSUNG+LE32T51B.html ) it changes the tab to display the correct colour, yet for some reason it always displays the content (a form) of the first tab. If I click to another tab and then back it displays the correct content.
Any ideas why, and what I can do about it?
(I have checked each form is inside the correct div tag)
Additionally, is there anyway I can get the tabs to display before the page loading is complete (I guess this means executing it before the body onload() event?)
Any suggestions would be much appreciated! Many thanks,
Jonny