PDA

View Full Version : Can't get new AnyLink Drop Down script to work. Help?



cdlong
02-12-2009, 07:29 PM
1) Script Title: AnyLink JS Drop Down Menu

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

3) Describe problem: I can't seem to get the drop down links to work. I am a novice at web development but I have been able to get the old dynamic drive anylink code to work. I can't get it to work this time.

I tried posting the code as its described without modification, but the links don't drop down. What am I doing wrong?

http://cdlbiz.com/form/company/company3.html

I saved the three files within the website folder:
* anylinkmenu.js
* menucontents.js
* anylinkmenu.css

Pasted the code in the head section:
<link rel="stylesheet" type="text/css" href="anylinkmenu.css" />

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

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

/***********************************************
* AnyLink JS Drop Down Menu v2.0- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm for full source code
***********************************************/

</script>

And then established the anchor link but it doesn't drop down. Any thoughts?

Thank you.

ddadmin
02-12-2009, 11:51 PM
Are you still having problems? In FF3 and IE7 I see the drop downs working.

cdlong
02-12-2009, 11:57 PM
Thanks for your inquiry. I did figure out how to get the drop down to work. But now it seems that its adding an extra folder to all of my links. For example, instead of linking to company/company.html, the page tries to link to company/company/company.html. When I look at the code, my links are accurate. Any thoughts?

By the way, I did the drop downs on the home page the "old way" and would prefer the new way that links to menucontent.js. I'll update the home page once I get everything working right in my test page (www.cdlbiz.com/form/company/company3.html).

ddadmin
02-13-2009, 12:18 AM
The script doesn't modify the href attribute of the anchor links in anyway. What browser does the problem occur in? Right now looking at your page, the anchor link "Solutions" links to http://cdlbiz.com/form/company/company3.html

cdlong
02-13-2009, 01:22 AM
The problem happens in IE and FF.

I don't know why the extra folder is appearing in the href attributes. This is the code for those links:

<a href="#" class="menuanchorclass" rel="anylinkmenu1" style="text-decoration: none">
<font color="#FFFFFF">COMPANY</font></a></font></td>

<a href="#" class="menuanchorclass" rel="anylinkmenu2" style="text-decoration: none">
<font color="#FFFFFF">SOLUTIONS</font></a></font></font></td>


This is my menu content:

var anylinkmenu1={divclass:'anylinkmenu', inlinestyle:'', linktarget:''}
anylinkmenu1.items=[
["About Us", "company/company.html"],
["Management Team", "company/team.html"],
["Overview Presentation", "images/FormationOverview_908.ppt"]
]

var anylinkmenu2={divclass:'anylinkmenu', inlinestyle:'', linktarget:''}
anylinkmenu2.items=[
["Connectivity", "products/connect.html/"],
["Record and Replay", "products/record.html/"],
["Rugged Data Storage", "products/ruggedstorage.html"],
["Ruggedized Computing", "products/computing.html"],
["Configured Solutions", "products/configured.html"]
//
]
etc.

cdlong
02-13-2009, 01:56 AM
OK - now I really messed it up. For some reason the drop downs aren't working.

I think I'm calling it a night.

ddadmin
02-13-2009, 02:55 AM
The menus still drop down for me at the moment. Regarding the link issue, if you want an anchor link to actually be hyperlinked, you need to specify that inside its A element, for example:


<a href="http://cdlbiz.com/form/company/company3.html" class="menuanchorclass" rel="anylinkmenu2" style="text-decoration: none">
<font color="#FFFFFF">SOLUTIONS</font></a>

cdlong
02-13-2009, 03:09 AM
I figured out what I changed that made the drop downs stop working. About the anchor links. I do know that if I want an anchor link to be hyperlinked I need to specify that inside its A element. Just can't figure out why the hyperlinks have the extra "company" folder after I publish it when it's not in the code anywhere.

I'm going to start a new thread about this new problem. Maybe someone else has experienced the same thing. Thanks.