View Full Version : Having problems with JavaScript in IE.

08-26-2011, 03:57 PM
I'm currently in the process of updating our old website as the layout is just terrible and it's hard to find products on it.

This new layout has drop down menus, accordion menus and an image enlarger all from JavaScript. They work wonders in Firefox and Google chrome but, as usual, Internet Explorer has decided not to load it right for me. I've got several problems...

Images won't show up most of the time
Not able to click on linked images and the links from the drop down menu
Accordion menu won't work, it just displays as one long sidebar
When it does work, it shows a big gap between each main header rather than keeping them close together
The drop list from the drop down menu hides behind the accordion menu

Is there anything I can do that makes IE accept the javascripts?

Unfortunately the new layout isn't up live so I've nothing you can link to. However, if there's any coding that you need I'll be more than happy to post it on. Thanks for your time!

08-26-2011, 04:04 PM
I could also add images of what IE is doing if that helps?

08-26-2011, 06:49 PM
Can't you make a test folder on your site and add the code to it? It's so much easier to TS something we can se.

08-26-2011, 11:22 PM
Good old Internet Exploder. I had issues like this when designing a site for a college project. I ended up getting a Browser Detection Script. If the user was using IE, it would switch stylesheets, vise versa if using Chrome, Safari or Firefox. Simple and worked a treat.

08-30-2011, 03:39 PM
Sorry for my delayed response, I've not had time to come back onto here.
@sunfighter, oh, I never thought thought of doing that. Of course, I'll put it up soon (hopefully!)

@tweezy I've attempted using a different style sheet for IE, but even then I couldn't figure out why it wasn't liking the menus. I'm no expert coder whatsoever, I can do simple stuff as I've made a website before and purposely avoided JavaScript. But this new site I've no other option but to use it and I wish I hadn't started as it's really making my brain explode, lol.

08-30-2011, 05:22 PM
Okay, I've uploaded a sample of the site onto a different directory.
I've used a template for this, so the parts I've edited will be a mess. I completely understand that I fail at coding so please be harsh and let me know what I've done terrible wrong, thanks!


Also, ignore the nav and background - still need to work on the images. :P

And before I go, I've thrown in a quick example of the image enlarger in there.
Any ideas where I've gone wrong? Thanks.

08-30-2011, 06:44 PM
I use IE8, I see no major difference in it and FF, chrome, or opera. Js works same in all browsers. Please explain what is the problem in the up loaded page.

Old Pedant
08-30-2011, 09:51 PM
Yeah, it looks like crap in MSIE 7. The top menus pull down *behind* the side menu. And the side menu items are separated by a lot of space, vertically.

But the JS code seems to work just fine.

So I'd say it's all CSS issues.

The way I approach this kind of thing: Rather than going into the CSS file and mucking around, I try adding style="..." to various things on the page. When I find the style change that makes it work, *then* I go change the CSS file to match and get rid of the style= stuff.

So, for example, I might try adding style="z-index: 99;" to on of the drop down menus that is showing up behind the side menu, just for starters.

08-31-2011, 11:06 AM
Thank you, I'll have a look through it and see what I can do.
I really appreciate you two going through this with me, it's been driving me insane for weeks!

08-31-2011, 11:37 AM
Ahh! I've found out why the top menu is pulling under the accordion menu, turns out that I had to have the position:auto changed to either relative, fixed or absolute. I've switched it to relative and it's no longer overlapping.

Also, with the dreadful spacing between the accordion menu, I've taken out some of the margin and paddings and have inserted the height and that has sorted that problem also.

I can finally move onto the rest of the site!! Thank you everyone! :)