HTML Dog javascript edit

I grabbed code from htmldog to create drop down menus.  The drop downs shift to the right when viewed in IE6.  I am not familiar with javascript.  Is there any edits I can do to the script to make this function slightly better?

Html Dog original script that works good in IE 6
http://htmldog.com/articles/suckerfish/dropdowns/example/bones1.html

The drop downs on my site are under the "Our Kids" and "Photos" buttons:
http://projectangelhugs.com/gallery_angels/index.htm

The css is here:
http://projectangelhugs.com/project.css

<script type="text/javascript"><!--//--><![CDATA[//><!--
 
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);
 
//--><!]]></script>

Open in new window

nsitedesignsAsked:
Who is Participating?
 
David S.Connect With a Mentor Commented:
The dropdown menus aren't working in IE6 or IE7. I don't see why they aren't working in IE7, but they aren't working in IE6, because you didn't include the script in that page.

Anyway, to get them to line up correctly in IE, give "#navigation li" position:relative and change

#navigation li:hover ul, #navigation li.sfhover ul { /* lists nested under hovered list items */
  left:auto;
}

to

#navigation li:hover ul, #navigation li.sfhover ul { /* lists nested under hovered list items */
        left: 0;
}



0
 
nsitedesignsAuthor Commented:
Perfection!

p.s.  I did forget to add the javascript to the internal gallery pages.  All the other pages on the site have the script added.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.