Results 1 to 7 of 7

Thread: Smooth Menu Navigation inside different folders

  1. #1
    Join Date
    Jan 2009
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Smooth Menu Navigation inside different folders

    1) Script Title: Smooth Menu Nav

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

    3) Describe problem: I am using the Ajax version of this. Everything works great, except when I try and use the script inside a folder. I checked all my links in both the <head> of the page and ddsmoothmenu.js. Like I said works perfectly unless I have it inside a folder. Actually once I start trying to get it to work in a folder, it stops working on all the other pages.

    Any thoughts?

    Thanks,
    Dave

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You must have some links that are broken. Could you post a link to your site so we can take a look?
    Eddy Proca
    I love Dropbox. Get it through my girlfriend's referral link (I reached my limit) and both you and her get 500 MB extra! Thanks and you're welcome!

  3. #3
    Join Date
    Jan 2009
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    I figured out that, inside the ddsmoothmenu.init tag on the .js file, if I have the link as just "smoothmenu.htm" it will work fine in that directory, but won't find the file in another folder (makes sense, relative link). If I change this to be "http://www.basiclives.com/smoothmenu.htm" it no longer works on either page. There must be another place I need to change the link, I can't figure out where.

    PAGES:
    http://www.basiclives.com/index3.html

    http://www.basiclives.com/resources/index2.htm

    http://www.basiclives.com/smoothmenu.htm

    SCRIPTS
    http://basiclives.com/ddsmoothmenu.css

    http://basiclives.com/ddsmoothmenu.js
    Last edited by dmrgraphics.com; 03-03-2009 at 01:33 PM.

  4. #4
    Join Date
    Jan 2009
    Posts
    17
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Got it!

    I made did something that seems to work, I updated the smoothmenu.js with the following:

    ddsmoothmenu.init({
    mainmenuid: "smoothmenu-ajax",
    //customtheme: ["#1c5a80", "#18374a"], //override default menu CSS background values? Uncomment: ["normal_background", "hover_background"]
    contentsource: ["smoothcontainer", "../../smoothmenu.htm"] //"markup" or ["container_id", "path_to_menu_file"]
    })

    Instead of using an absolute path http://www..., I kept it as a relative path but made it "../../smoothmenu.htm" instead of just "smoothmenu.htm".

  5. The Following User Says Thank You to dmrgraphics.com For This Useful Post:

    Vey (03-03-2009)

  6. #5
    Join Date
    Mar 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by dmrgraphics.com View Post
    I made did something that seems to work, I updated the smoothmenu.js with the following:

    I kept it as a relative path but made it "../../smoothmenu.htm" instead of just "smoothmenu.htm".
    I had a conflict between IE and Firefox.

    When I was working on a page inside a folder where I had a scripts folder and the smoothmenu.htm page, the smoothmenu.js file couldn't find the htm page. I tried putting it in the scripts folder and in the main part of the folder, but it still couldn't find it using IE7 or 8

    It worked fine for Firefox 3, but didn't work for IE. I put in a relative link into the smoothmenu.js file, back to the home folder and it found it with no trouble.

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

    Default

    Instead of specifying a relative path to smoothmenu.htm, which can be different depending on where the page showing the menu is:

    contentsource: ["smoothcontainer", "../../smoothmenu.htm"] //"markup" or ["container_id", "path_to_menu_file"]

    You can make a small change to the .js file that supports an absolute URL to it within your own domain:

    Code:
    contentsource: ["smoothcontainer", "http://www.mysite.com/smoothmenu.htm"] //"markup" or ["container_id", "path_to_menu_file"]
    To do this, inside ddsmoothmenu.js, find the below line, and add to it the line in red:

    Code:
    var $headers=$mainmenu.find("ul").parent()
    setting.contentsource[1]=setting.contentsource[1].replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
    That should do it.
    DD Admin

  8. #7
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    I added smoothmenu to my site and its working well on IE, Chrome but it doesn't work on FF. Screen going white.
    I don't know how to solve that problem.

    http://www.galway.net.pl/poorclares/index.html

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
  •