PDA

View Full Version : DD Tab Menu installation problem



Blackbird
12-07-2009, 01:10 PM
1) Script: DD Tab Menu

2) http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm


Hi,

I have installed the “solid block” DD Tab Menu on a website and we are having a problem, which I’m not sure if it is script related or something else related to the pages themselves. When clicking on any of the nav buttons, the banner and nav bar appear but the rest of the page loads as if it is separate; however, I’m thinking that I have done something wrong when installing the menu. Could someone please look at the coding for the menu and see if it is correct? The site itself is www.blackbirdbakerybristol.com.



<script type="text/javascript">
ddtabmenu.definemenu("ddtabs3", 1)
</script>

<div id="ddtabs3" class="solidblockmenu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="menu.html">Menu</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html" style="border:none">Contact</a></li>
</ul>
<br style="clear: left" />
</div>


Also, what copyright notice should I use with this menu? The page the menu came from does not have one.

Thank you in advance for your help and your time.

Renee

ddadmin
12-08-2009, 06:35 AM
At the moment the script on your page doesn't run for me, since the reference to the .js file is broken:


<script type="text/javascript" src="javascript/ddtabmenu.js">


<script type="text/javascript">
ddtabmenu.definemenu("ddtabs3", 1)
</script>

You'll need to update the code in red above so it correctly points to where the .js file is on your server. As far as where the credit notice should go, it should be in between the script tags, ie:


<script type="text/javascript" src="ddtabmenufiles/ddtabmenu.js">

/***********************************************
* DD Tab Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

Blackbird
12-08-2009, 03:07 PM
Thank you. At this time, I have updated the code only on the contact page with the correct location of the .js file, www.blackbirdbakerybristol.com/contact.html, since the page doesn't seem to load correctly.

The updated code is:



<script type="text/javascript" src="ddtabmenu.js">

/***********************************************
* DD Tab Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

<script type="text/javascript">
ddtabmenu.definemenu("ddtabs3", 1)
</script>

I am also getting an error message in IE that says 'ddtabmenu' is undefined.

Thanks again for the help.

ddadmin
12-08-2009, 04:30 PM
FYI the error will appear in all browsers, as comparing your version of ddtabmenu.js to the original, the two are different. Your version is missing commas (,) that should follow each function within the script, ie:


definemenu:function(tabid, dselected){
this[tabid+"-menuitems"]=null
this[tabid+"-dselected"]=-1
this.addEvent(window, function(){ddtabmenu.init(tabid, dselected)}, "load")
},

Did you run the script through some compression software perhaps? Anyway, try redownloding the original .js file, and uploading that one.

Blackbird
12-08-2009, 07:25 PM
No, I didn't run the script through any compression software.

Ok, I have redownloaded the original .js file and uploaded it to the server. However, the page is loading the banner and nav bar, then the rest of the page loads, and I haven't experienced this with any of your other scripts before.

As well, I am now getting an error message that 'document.getElementByld(...) is null or not an object. Not sure if this is a problem or not.

I do appreciate your help with this.

ddadmin
12-09-2009, 02:29 AM
You need to give your menu's outermost DIV a id of "ddtabs3", as that's what you have specified in your initialization code:


<script type="text/javascript">
ddtabmenu.definemenu("ddtabs3", 1)
</script>

Blackbird
12-09-2009, 12:03 PM
That was certainly a stupid mistake on my part. Sorry.

I have now placed the correct code on all 4 pages; however, on the nav bar, menu is retaining the hover color regardless of the page. If you have time, could you please let me know why this is happening? I have tried looking over the code on the page, and it is the same as the others www.blackbirdbakerybristol.com/menu.html.

Thanks again!

ddadmin
12-10-2009, 05:08 AM
Are you asking why the 2nd menu item is always highlighted? That's because in the initialization code on each page, you've specified the 2nd item be to selected, by way of the 2nd parameter:


<script type="text/javascript">
ddtabmenu.definemenu("ddtabs3", 1)
</script>

1=2nd tab, 0=1st etc.

Blackbird
12-10-2009, 11:38 AM
Thank you for your help and your time. Things are working now.