SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Jul 24, 2006, 11:27 #1
- Join Date
- Jul 2006
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Son of Suckerfish causing IE pageload error
I have validated my html, php and css from W3C on the website I am currently working on.
I have found that implementing the Son of Suckerfish dropdown menu works well in Firefox, but not at all in IE. I believe the javascript from the sfHover.js file is causing this pageload error in IE:
Code:Line: 3 Char: 2 Error: 'document.getElementByld(...)' is null or not an object Code: 0 URL:http://www.umedplans.com/index2.php
Code:sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover);
Does anyone have any ideas why this is doing this or how to fix it?
-
Jul 24, 2006, 21:49 #2
- Join Date
- Jun 2004
- Location
- Mumbai, India
- Posts
- 541
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The only error i can see is that the the object with id="nav" is not present in the page at all. It is case sensitive.
Vikrant Korde
S Y S T I M E, Mhape,
Mumbai, Maharashtra, India.
-
Jul 25, 2006, 07:28 #3
- Join Date
- Jul 2006
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What exactly do you mean? And how do I fix that?
-
Jul 25, 2006, 07:40 #4
- Join Date
- Jul 2006
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
vikrant, thank you so much for your help. I changed up the code and it's working properly now. If you look at my html, you'll see that in the navigation menu section, I had to change the one dropdown I was trying to use (Products) to id="nav" and the other ones to a new class called "nav2." Do you think there's any way I can setup the sfHover to work with every dropdown? or do I need to replicate the javascript and have it say "nav", "nav2", "nav3", etc. Because I was trying to use "nav" as a class and not as an id so that it would work on all of the menu items. I found that it HAS to be an id in the css for this particular javascript to work. Any suggestions on how to make it work with every menu item, so that dropdowns are easily updatable later on?
Bookmarks