View Full Version : Smooth Navigational Menu

03-03-2009, 01:24 PM
1) Script Title: Smooth Navigational Menu

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

3) Describe problem:


First of all thank you for this wonderful script! I'm new in javascript so i'm glad i found this script.
But i got a little question. I got a problem with the arrows.

This works for my index.html page:

arrowimages: {down:['downarrowclass', 'main_images/icons/down.gif', 23], right:['rightarrowclass', 'main_images/icons/right.gif']},

but not in my other pages because it has to be:

arrowimages: {down:['downarrowclass', '../main_images/icons/down.gif', 23], right:['rightarrowclass', '../main_images/icons/right.gif']},

is there a simple solution for this?

Regards, Nicky Zeeman

03-03-2009, 08:53 PM
Just use absolute URLs to the images inside the .js file:

arrowimages: {down:['downarrowclass', 'http://www.mysite.com/main_images/icons/down.gif', 23], right:['rightarrowclass', 'main_images/icons/right.gif']},

03-07-2009, 09:50 PM
Sorry for the late response but i was on holiday.
That works fine if it's online but it also have to work offline. Is there an easy solution for to let it work offline?

03-07-2009, 11:01 PM
It depends on what how files are accessed "offline", in other words, the structure of those URLs. Try creating a blank page, and put in:

<script type="text/javascript">

Save this page locally and access it in the browser. You should get an alert that tells you the base URL of that page offline. Then, inside ddsmoothmenu.js, try editing the path to the images using this info:

arrowimages: {down:[location.hostname+'somepath/downarrowclass', 'location.hostname+/down.gif', 23], right:['rightarrowclass', 'right.gif']},

03-11-2009, 02:12 PM
Thanks for the response. But however i don't really know what you mean. When i use this code it returns a blank alert.

<script type="text/javascript">

I don't really know what to do with this actually:p Like i said i'm new to javascript and i don't know what you mean with this. Could you please explain it a bit more to me?
Or could you give an example?

Regards, Nicky