PDA

View Full Version : tab content script help



jinen
06-18-2005, 06:00 PM
Hi,

I followed the instructions on http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm. It is a great effect.

edit 6/18: I actually used http://www.dynamicdrive.com/dynamicindex3/tabdocviewer.htm

However, when I posted a quick sample on http://www.geocities.com/jinenkamdar - when the user clicks on a tab, the page opens up (as if clicking a 'regular' link) instead of in the designated space below.

When I tested this locally on my harddrive, the website worked as designed, so I'm not sure why uploading it on geocities causes this different behavior?

Any ideas on how I can fix this?

Thanks so much,

-Jinen

jscheuer1
06-18-2005, 07:53 PM
Geocities adds a number of scripts to the pages displayed on its servers. One of these scripts hijacks two commonly used variables (i & j). This breaks any script using i and/or j placed on a page on Geocities. There could be other problems but, to start with, replace:
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}with:
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (xdt=0; xdt<tabobjlinks.length; xdt++)
tabobjlinks[xdt].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}and replace:
function detectSourceindex(aobject){
for (i=0; i<tabobjlinks.length; i++){
if (aobject==tabobjlinks[i]){
tabsourceindex=i //source index of tab bar relative to other tabs
break
}
}
}with:
function detectSourceindex(aobject){
for (xdt=0; xdt<tabobjlinks.length; xdt++){
if (aobject==tabobjlinks[xdt]){
tabsourceindex=xdt //source index of tab bar relative to other tabs
break
}
}
}

jinen
06-19-2005, 05:12 AM
Hi,

I actually sent you the wrong link of the script I used.. I used the Tabbed Document Viewer: http://www.dynamicdrive.com/dynamicindex3/tabdocviewer.htm -

I still went ahead and replaced 'i' with xdt, but I still have the same problem. The pages load on 'top' when you click on a link (e.g. Blog) and not in the designated area below.

Any other ideas?

http://www.geocities.com/jinenkamdar

Thanks.

jscheuer1
06-19-2005, 06:47 AM
I actually sent you the wrong link of the script I used.. You should be severely punished for that, lol. Anyways, after looking over a couple of the added scripts on your Geocities page I found one that is hijacking all iframes on the page. So, apparently they don't want you to display dynamic content in an iframe. Without going too much further I found they also frown on any scripts that allow you to display offsite content on their pages, opening it instead in the main window.

jinen
06-19-2005, 06:11 PM
sorry about providing the wrong link.. i apologize.

thanks for investigating this for me.. maybe i will try a different web-host that permits these kind of webpages. (ideas?)

thanks again!

-jtk

jscheuer1
06-19-2005, 06:40 PM
Check out this thread:

http://www.dynamicdrive.com/forums/showthread.php?t=1711&highlight=free+host