Results 1 to 5 of 5

Thread: Smooth Navigational Menu

  1. #1
    Join Date
    Mar 2009
    Location
    Amsterdam, The Netherlands
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Smooth Navigational Menu

    1) Script Title: Smooth Navigational Menu

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

    3) Describe problem:

    Hi,

    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:
    Code:
    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:
    Code:
    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

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Just use absolute URLs to the images inside the .js file:
    Code:
    arrowimages: {down:['downarrowclass', 'http://www.mysite.com/main_images/icons/down.gif', 23], right:['rightarrowclass', 'main_images/icons/right.gif']},
    DD Admin

  3. #3
    Join Date
    Mar 2009
    Location
    Amsterdam, The Netherlands
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    <script type="text/javascript">
    alert(location.hostname)
    </script>
    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:
    Code:
    arrowimages: {down:[location.hostname+'somepath/downarrowclass', 'location.hostname+/down.gif', 23], right:['rightarrowclass', 'right.gif']},
    DD Admin

  5. #5
    Join Date
    Mar 2009
    Location
    Amsterdam, The Netherlands
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the response. But however i don't really know what you mean. When i use this code it returns a blank alert.
    Code:
    <script type="text/javascript">
    alert(location.hostname)
    </script>
    I don't really know what to do with this actually 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
    Last edited by nickols; 03-12-2009 at 12:48 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •