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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David S.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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.