PDA

View Full Version : Two Tab Content Scripts on one page



Jebus
02-06-2011, 03:45 PM
1) Script Title:
Tab Content Script
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
3) Describe problem:

Hello!

Edit: suppose I should start with the fact I tried removing the first script and the 2nd one still doesn't work. Even if I use identical code just diff IDs and variables.

I'm currently working on a new design for a wow-guilds web-page.
(http://www.sagon.org/beastro/2.0/)
I started by using the Tab Content Script on the raid progress part which is working (as you can hopefully tell :P).
Then I want to use it again on the class-recruitment part. This however did not work. It only loads the pages on clicks but does not scroll the tabs every 2 sec as intended. It doesn't even load the first tab without clicking on it.

I've been using exactly the same sort of div and css setup (with different ids and classes of course). I even started over twice and copied everything exactly from the working tabs and content.

I've given the two scripts different variables:

The working one:

<script type="text/javascript">
var myraids=new ddtabcontent("raidtabs")
myraids.setpersist(true)
myraids.setselectedClassTarget("link")
myraids.init(3000)
</script>

The one that doesn't work.

<script type="text/javascript">
var myklasses=new ddtabcontent("klasstabs")
myklasses.setpersist(true)
myklasses.setselectedClassTarget("link")
myklasses.init(2000)
</script>

Also I have trouble understanding why the first one is working now because even after I deleted the:

.raid_content {display: none;}
@media print {.raid_content {display: block !important;};}
from the css file but it keeps working.

I've also tried removing the first one but the 2nd one still doesn't work. But after literally doing it exactly as the first one 3 times I just don't get whats wrong.

Any help is appreciated, I can give you more info if you'd like.

MVH
Jebus


P.S.
I am aware of the header problem but I'd like to fix javascript first :)

Jebus
02-06-2011, 05:44 PM
I solved with help from this
http://stackoverflow.com/questions/3236772/there-is-problem-in-tabcontent-js-script-and-i-couldnt-solve-this