PDA

View Full Version : Can Switch Menu and Tab Content scripts live together?



queenheaven.it
02-03-2007, 08:18 AM
1) Script Title: SwitchMenu and Tab Conent Script

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

3) Describe problem:

I have installed both above mentioned scripts and whenever they are loaded in the same page only the tab works while the switchmenu no longer.
The strange is that error( checked with Mozilla javascript console ) come from the tab script which is working perfectly!
You may check the error for testing in the following url:
http://www.hwt.it/zainetto/catalog/product_info.php?products_id=13840

The menu on left in all other pages of the site works 100% but stop only when it is loaded together with tab script.

Any idea of known incompatibility?

Thanks in advance

Rudy from Italy

jscheuer1
02-03-2007, 04:56 PM
I don't see any Dynamic Drive script credits on your page:

Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

The problem is that you are not using the code as shown on the demo page for SwitchMenu script:


SwitchMenu('sub1')

You have:


<div id=8999 class=switchcontent><span class="categoriaFiglia2_in">I Nostri PC Desktop&nbsp; ( 11 )</span><br></div><div class="categoriaMadre" onclick="expandcontent(9000);"><a href="index.php?cPath=9000" class="" title="Visualizza le sottofamiglie della categoria Notebook">Notebook</a>&nbsp; (160)</div><div id=9000 class=switchcontent><a href="index.php?cPath=9000

But, expandcontent is part of the tab script. In fact, the more I look at this the more it appears that you are not even using the:

http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm

script as you claim or, if you are, you have modified it or are simply not following the instructions from its demo page.

Also, the id of an element should begin with a letter, not a number. Class and id values should be quoted in the markup.

queenheaven.it
02-07-2007, 09:04 AM
Thanks John
sorry for the credits: I supposed they should be only in the JS but I have corrected and now it is ok.
It was my fault since I misunderstood the quoting of the markup.
Now works fine

Bye