PDA

View Full Version : Is this a CSS error?



Mentally
Jul 15th, 2009, 05:30 PM
So! I'm trying to currently make a nice "slider" menu with MooTools and I have just about gotten it to work with a few exception.

However, in FireFox, Chrome and I suspect other/older browsers, my slider button which is split in 2 just ruins the entire first impression of the website-to-be as it spans over most of my navigation menu, on top 'o that the right part of it just seem to slide off the screen as far as it can go.

Here's a link: http://mental.doesntexist.com

I'm not sure what it is, if it's an error on my part or that FireFox/Chrome/etc just doesn't recognize it in the way Internet Explorer does, though, I don't trust IE when it comes to anything coding-related.

Hope anyone can help!

Cheers.

Rowsdower!
Jul 15th, 2009, 09:58 PM
So! I'm trying to currently make a nice "slider" menu with MooTools and I have just about gotten it to work with a few exception.

However, in FireFox, Chrome and I suspect other/older browsers, my slider button which is split in 2 just ruins the entire first impression of the website-to-be as it spans over most of my navigation menu, on top 'o that the right part of it just seem to slide off the screen as far as it can go.

Here's a link: http://mental.doesntexist.com

I'm not sure what it is, if it's an error on my part or that FireFox/Chrome/etc just doesn't recognize it in the way Internet Explorer does, though, I don't trust IE when it comes to anything coding-related.

Hope anyone can help!

Cheers.

It's not a CSS error, it's a javascript issue of some sort. I'm not handy enough with javascript to offer a real solution, but for whatever reason the width and position of the indicator are not being changed to meet the "home" link on page load.

Mentally
Jul 15th, 2009, 10:52 PM
Hmm, I see!

I figured out that if I added a <script type="text/javascript"></script> it works as "intended" in FireFox and Chrome (I haven't checked with Opera) all though it doesn't change at all in Internet Explorer. Then again it worked as intended from before in IE.

I've been trying to look through my JS code but I can't seem to find a simple solution to the problem other than what said above. I'm not sure if I should just go ahead and add an empty script block into the source just to fix an error since that's just a sloppy and hasty solution.

Though when hovering over the links it seems to resolve itself for some odd reason.

Rowsdower!
Jul 15th, 2009, 10:58 PM
Hmm, I see!

I figured out that if I added a <script type="text/javascript"></script> it works as "intended" in FireFox and Chrome (I haven't checked with Opera) all though it doesn't change at all in Internet Explorer. Then again it worked as intended from before in IE.

I've been trying to look through my JS code but I can't seem to find a simple solution to the problem other than what said above. I'm not sure if I should just go ahead and add an empty script block into the source just to fix an error since that's just a sloppy and hasty solution.

Though when hovering over the links it seems to resolve itself for some odd reason.

On the whole, the script works. It fixes itself when you hover because it assigns inline CSS rules "on the fly" once it is running. There is an initial setup that is supposed to make the block hover on the "current" item and resize to fit it when the page loads, but for some reason this is not happening in non-IE browsers. It looks like it's just this initial setup that is failing you, not anything else -- just FYI.

If you ask a moderator to move your thread to the javascript forum you will probably get an answer in no time.