• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

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

0
nsitedesigns
Asked:
nsitedesigns
1 Solution
 
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
 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now