Log in

View Full Version : Problem Getting Smooth Menus to work when stored in seperate folder.



Bassun
01-15-2011, 06:08 AM
Hello -- I am using "Smooth Navigational Menu" but have ran into an odd problem. I moved the menu CSS + JS files into a folder named "css" along with my standard CSS file. The menu structure is like this:

z:sitename/CSS/
If I have my "default.htm" in the "sitename" folder, then point to my CSS with href="css/ddsmoothmenu.css" it works fine. Standard CSS and the menu both.

If I move the file into a folder like:
z:sitename/page/ then change my path to show like this:
href="../css/ddsmoothmenu.css" /> it no longer works. However, my
rel="stylesheet" href="../css/basiccss.css works fine, so I'm confused. I believe I am pointing at the right folder, since the basiccss is working fine. (the basic css for the page)

I changed the following paths (although I'm not currently using the verticle):
<link rel="stylesheet" type="text/css" href="../css/ddsmoothmenu.css" />
<link rel="stylesheet" type="text/css" href="../css/ddsmoothmenu-v.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="../css/ddsmoothmenu.js">

contentsource: ["smoothcontainer", "../css/smoothmenu.htm"]

Those are the same ones I changed when I was one folder above and it was working fine. I cannot see where there is an issue at, it looks to me like it is exactly the way it should be. Again, the ../css/basiccss.css works fine for my regular CSS, so I'm lost.

To recap, it works fine when all in the same folder using just "ddsmoothmenu.js" it works fine when in a sub folder called CSS with "css/ddsmoothmenu.js", but a sister folder it does not work with "../css/ddsmoothmenu.js" but using the same path my standard css does.

Anyone had similar issues?

Thanks,
David

jscheuer1
01-15-2011, 01:31 PM
To really sort this out we need a link to the page.

The only thing that jumps out for me from your post is:


z:sitename/CSS/

and (and similar):


href="../css/ddsmoothmenu.css" />

Upper and lower case paths, filenames, and extensions matter on most servers.

Other general guidelines that may apply here are:


Relative paths used in external javascript files are relative to the page that uses the script.


Relative paths used in css files are (with some exceptions) relative to the css file.


None of this may apply here. If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

Bassun
01-15-2011, 01:46 PM
John -- First off, thanks for the reply.

The CSS vs css is just a typo I made in the post. I was trying to use caps when talking about CSS and lower for paths. On the site everything is 100% lower case to avoid caps issues. Good catch though!

Secondly, the issue is in dev not prod currently. It is a new site build and I basically put a slate up and was working on my folder structure at home before I uploaded all of the files. I don't want 100 different files all in one folder if I can avoid it. I'm unable to upload the files until this evening, however, unless someone finds some fix in the meantime - I can certainly upload the new folder structure and put up a broken page so you can see exactly what I'm dealing with. In hindsite, that would have made the most sense anyway since the site isn't really being used yet. And I was struggling with explaining the issue clearly.

I will post a second reply once uploaded, however, it will be late tongiht before I will have time to sit down and work on the site. Thanks again!

David

Bassun
01-16-2011, 05:12 AM
Ok ... as strange as it sounds, when I attempted to replicated the problem on the site; it worked. SO... IDK. Odd, but good news I suppose. Only issue now is that the image I am using for the down arrow and right arrow doesn't show up in the "deeper" pages, only the default page; and I discovered an issue with how I was laying out my paths. Anywho, I will muck around with the image; but for now I think I'm ok. Thanks for the offer to help!

David

jscheuer1
01-16-2011, 07:42 AM
One thing you can try is to use the image's absolute path.

About that other stuff - Some browsers just won't do things involving frames, iframes, and/or AJAX locally. This varies by browser as to the reason(s) and as to which one(s) of these three are affected.

Even when none of these are involved, a given browser may see a local version of a site that spans more than one folder as having pages on more than one domain. If that happens, it will activate the browser's security routines and deny access for certain types of what it sees as cross domain content and/or scripting.

And, of course, no server side code will work in local testing without a local server.

Because of this I usually test anything complex and especially anything involving any of those three things I mentioned, or involving server side code on a local server. I use WAMP. There are others.

If you want help tracking down the issue with those images, let me know - Oh and include a link to a page that shows the problem.

Bassun
01-16-2011, 06:32 PM
Yeah, I was able to fix the image issue. I had cleaned up my folder structure once I fixed the pathing issue with the menu, and out of habit had made the images with a capital letter. When I pushed the files back up to the server, I didn't notice the error on the image name that I had corrected once before.

Out of habit I was looking for lower case, and as soon as I went and looked after stepping away it was obvious. Now, everything is working exactly as it should be.

Simple mistakes coming from rust... Thanks again!

David

Bassun
01-17-2011, 07:00 AM
Ok, I'm back to ground zero again. Not sure what I changed; but I'm back to no menu other than on my "home" page. What I thought was me knocking rust off and figuring it out, must have been more akin to a blind squirrel and the proverbial nut...

SO -- to recap. At that home page or top level folder (my default.html page), the menu works fine, even though the menu is one folder level below. (/css/ddsmoothmenu.js)

Everywhere else, the menu fails. (in root/pages/basic/basic.html for example referencing the CSS and JS with ../../css/<filenam>.css [or .JS accordingly]) I only have a few working links on the site as I was setting up a template page when I realized I had fubared it again.

Here's the url: http://fishingthenrv.com
From the home page all is ok.
If you click on "Basics" out of the menu bar, it will load the page and all CSS and even the JavaScript file fine (according to the view source links); but the menu will not work.

Again, most of the links are to "#" etc since there isn't any content yet...

It must be something simple since I had it working the other day and have since changed something I didn't realize... but I can't seem to "see the light" so to speak...

Thanks again for any help offered... and if any one has some "Gremlin-Be-Gone" I'd love a can lol...


Thanks,
David

jscheuer1
01-17-2011, 09:49 AM
There could be other problems but the /pages/basics/basics.html page is missing the highlighted:


<body>
<div class="nav">
<div id="banner" >
<img src="images/title7.png" alt="Fishing the New River Valley"
height="175" width="1000"/>
</div>

<div id="smoothcontainer">
<noscript>
<a href="link to site map for search engines and user with JS disabled">Site map</a>
</noscript>
</div>


<div id="maincontainer">
<div id="topsection"> <div cla

It can't work without that. And, as you say, the paths look right. The script and the css are loading. The smoothmenu.htm file is where you say to look for it. Only thing missing is a place to put it.

Fix that and make sure the cache is cleared, and refresh the page. Let me know what happens.

Bassun
01-17-2011, 12:34 PM
Touchee'.


I'm not sure how I managed to delete that, but sure enough the most obvious answer is it... Occam's Razor rules again.

Thanks for the pick up, and hopefully I can keep things strait now. Obviously I added it in, and solved the issue hands down. I will get everything else cleaned up shortly and move forward again. Thanks John, I appreciate the help!


David