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

The drop downs on my site are under the "Our Kids" and "Photos" buttons:

The css is here:

<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);

Open in new window

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 */


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

nsitedesignsAuthor Commented:

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.

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.