SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2004
    Location
    Atlanta, GA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Paths in the XMenu4 Library

    The javascript and css files are in a couple of different places in the XMenu4 example. I have tried putting those files into their own folders (and changed the paths in the appropriate files -- code shown below).

    The menus display downgraded instead of across the top.

    I can live with having the files scattered to make it work, but would much prefer to have them neatly organized. I think I have a relative path wrong in one of the references [code at bottom of post].

    I would greatly appreciate it if someone could look at these snippets and tell me what I'm doing wrong. Also, the pages folder will potentially contain subfolders. What is the best way for pages in the subfolders to reference the css/js files?

    Folder structure:

    website
    \css
    \images
    \js
    \pages


    From website\pages\xmenu4_1.html:
    <link rel='stylesheet' type='text/css' href='../css/s6.css' />
    <link rel='stylesheet' type='text/css' href='../css/xmenu4_1.css' />
    <script type='text/javascript' src='../js/x_load.js'></script>
    <script type='text/javascript'>
    xInclude('../js/xmenu4_1.js', '../js/x_debug.js');
    </script>

    From website\js\xmenu4_1.js:
    if (!xIE4 && !xNN4) {
    xInclude('../x_core.js', '../x_event.js', '../x_dom.js', '../xmenu4.js', '../css/xmenu4_1_dhtml.css');
    window.onload = xOnload;
    }

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi MBrown, glad to have another Southerner on-board!

    For the file at "website\pages\xmenu4_1.html", the paths look correct.

    For the file at "website\js\xmenu4_1.js", try this:
    Code:
    if (!xIE4 && !xNN4) {
    xInclude('x_core.js', 'x_event.js', 'x_dom.js', 'xmenu4.js', '../css/xmenu4_1_dhtml.css');
    window.onload = xOnload;
    }
    I probably should have written the above something like this:
    Code:
    if (!xIE4 && !xNN4 && xInclude('x_core.js', 'x_event.js', 'x_dom.js', 'xmenu4.js', '../css/xmenu4_1_dhtml.css'))
    {
      window.onload = xOnload;
    }

  3. #3
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BTW, I'm assuming the X library files are in "website\js".


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
  •