Go Back   Dynamic Drive Forums > DD Scripts > Dynamic Drive scripts help
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-05-2008, 04:11 PM
Mng026 Mng026 is offline
Junior Coders
 
Join Date: Apr 2008
Posts: 32
Thanks: 4
Thanked 1 Time in 1 Post
Default Anylink Drop Down not working in subdirectories

1) Script Title: Anylink Drop down menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.htm

3) Describe problem: Drop down does not appear when I link to it in subfolders. I realize I have to update the links, but couldn't seem to locate the missing code. I realize this is probably a pretty stupid question, but it's in fact driving me nuts, and any help is appreciated. A link to a page that is not functioning is http://www.mikegrantonline.com/login/clients.html --- The top three tabs should be dropping down as seen on the homepage. Thanks in advance.

Mike
Reply With Quote
  #2  
Old 08-05-2008, 05:12 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,005
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

Your page is in violation of Dynamic Drive's usage terms, 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.


You may take care of the above violation by changing the external tag from (and similar) on all pages using this menu:

HTML Code:
<script src="../js/dropdown.js" type="text/javascript"></script>
to:

HTML Code:
<script src="../js/dropdown.js" type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
Also, this:

Code:
<!--
and this:

Code:
//-->
don't belong in the external script file.

On to your problem - Where you have:

Code:
dropdownmenu(this, event,'../menu1', '135px')
and similar, it should be:

Code:
dropdownmenu(this, event,menu1, '135px')
Since you are accessing the same menu from the same script, no path is required. In fact, that part of the call is not a path at all but a reference to an array. In the case of the example above, it is this array (from the script):

Code:
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="about.html">About Mike Grant</a>'
menu1[1]='<a href="resume.html">View Resume</a>'
That's where the path will matter. Since you are using it from a different folder and it is referencing pages in the root, the network path will do for any page in any folder (including the root) on the site:

Code:
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="/about.html">About Mike Grant</a>'
menu1[1]='<a href="/resume.html">View Resume</a>'
One other thing about this script that has nothing to do with your problem is that it has always had a minor error here:

Code:
dropmenuobj.style.left=dropmenuobj.style.top=-500
That line should be:

Code:
dropmenuobj.style.left=dropmenuobj.style.top='-500px';
This might never cause an issue with your particular installation, but it might. So may as well take care of it now.
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #3  
Old 08-05-2008, 05:29 PM
Mng026 Mng026 is offline
Junior Coders
 
Join Date: Apr 2008
Posts: 32
Thanks: 4
Thanked 1 Time in 1 Post
Default

Hi John,
Thanks for your quick reply. In response --

1. Sorry about the notice, I didn't realize it should even appear on external linked files. I'll put it in there.

On to the problem --
2. When dreamweaver 'updated my links' I saw it updated the '../menu1' etc. arrays, I thought this was odd, and changed it, but it did not work, so I changed it back to the way it was. Anyhow, I modified it like you suggested, and am still not seeing my drop down, any other thoughts?? Thanks in advance..

Mike
Reply With Quote
  #4  
Old 08-05-2008, 05:53 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,005
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

Quote:
Originally Posted by Mng026 View Post
Anyhow, I modified it like you suggested
I don't think so, remove the quote marks so that it looks like what I put in my post. Do it like this:

Code:
dropdownmenu(this, event,menu1, '135px')
Not like you currently have it:

Code:
dropdownmenu(this, event,'menu1', '135px')
Thanks for fixing the credit.
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
The Following User Says Thank You to jscheuer1 For This Useful Post:
Mng026 (08-05-2008)
  #5  
Old 08-05-2008, 05:56 PM
Mng026 Mng026 is offline
Junior Coders
 
Join Date: Apr 2008
Posts: 32
Thanks: 4
Thanked 1 Time in 1 Post
Default

oops! Dreamweaver must of added the '' when it changed the array to a link -- that did the trick indeed! Thanks a bunch.

Mike
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:28 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.