Results 1 to 4 of 4

Thread: Smooth Navigational Menu v1.51, external file

  1. #1
    Join Date
    Mar 2012
    Location
    La ferté alais
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Smooth Navigational Menu v1.51, external file

    1) Script Title: Smooth Navigational Menu v1.51

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

    3) Describe problem: I want to put the menu in an external file. I think I followed the instructions but I can't get it to work.
    I put the files there: http://photosjg.x10.mx/smoothmenu/
    essais-InPage.html works fine but it's not what I want.
    essais-External.html
    If someone can look at the code and tell me what's wrong that wouls be wonderful.
    Thanks a million.
    jacques.gourdon@gmail.com

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

    Default

    Try removing the first two initialization codes (in gray) from your page, as you only have one menu on the page, mainly, the 3rd Ajax one:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    
    <link rel="stylesheet" type="text/css" href="ddsmoothmenu.css" />
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="ddsmoothmenu.js">
    
    /***********************************************
    * Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    
    <script type="text/javascript">
    
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu1", //menu DIV id
    	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu', //class added to menu's outer DIV
    	//customtheme: ["#1c5a80", "#18374a"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu2", //Menu DIV id
    	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
    	//customtheme: ["#804000", "#482400"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu-ajax",
    	orientation: 'h',
    	classname: 'ddsmoothmenu',
    	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"]
    })
    
    </script>
    </head>
    
    <body>
    <h2>Example 1</h2>
    <div id="smoothcontainer">
    <noscript>
    <a href="link to site map for search engines and user with JS disabled">Site map</a>
    </noscript>
    </div>
    
    </body>
    </html>
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    Jacques Gourdon (07-31-2012)

  4. #3
    Join Date
    Mar 2012
    Location
    La ferté alais
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I looked into it a bit more. I took the http://www.dynamicdrive.com/dynamici...smoothmenu.htm file and edited out most of it to keep only the 3 menus, 2 inpages and one external.
    Works fine:
    http://photosjg.x10.mx/smoothmenu/externalfile.html

    But if I suppress the div for one of the inpages, the external menu does not show.
    http://photosjg.x10.mx/smoothmenu/ex...gInternal.html

    external menu not showing.
    I want only the external.
    Help please !
    jacques.gourdon@gmail.com

  5. #4
    Join Date
    Mar 2012
    Location
    La ferté alais
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Fine, that does it.
    Applied the change: http://photosjg.x10.mx/smoothmenu/ex...gInternal.html

    Super!
    Now I'm in business.
    IMHO it does not make much sense to have the code for the menu in all pages. In an external file, a change to that file applies to all the pages. That's the wway to do menus.

    Thanks a million.

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
  •