JavaScript suckerfish的儿子下载IE修复

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript suckerfish的儿子下载IE修复相关的知识,希望对你有一定的参考价值。

<script type="text/javascript">
<!--//--><![CDATA[//><!--
	function insertAfter(newElement,targetElement) {
		var parent = targetElement.parentNode;
		if(parent.lastChild == targetElement) {
			parent.appendChild(newElement);
			} else {
			parent.insertBefore(newElement, targetElement.nextSibling);
		}
	}
	
	sfHover = function() {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className += " sfhover";
				var submenu = (this.getElementsByTagName("UL"))
				if(submenu.length) {
					var iframe = $(document.createElement("iframe"))
					iframe.setAttribute("scrolling", "no")
					iframe.setAttribute("frameborder", "0")
					iframe.addClassName('menu_iframe');
					$("nav").insertBefore( iframe )				
					var ulSub =  $(submenu[0]);
					if ( $(this).up(0) != $("nav") ) {
						parentWidth = this.up(0).scrollWidth
						parentOffset = this.up(0).offsetLeft + this.up(1).offsetLeft + 999
						offsetTop = this.up(0).offsetTop + this.offsetTop + 3
						iframe.style.left = parentWidth + parentOffset
						iframe.style.top = offsetTop;
					}
					else {
						iframe.style.top = ulSub.offsetTop  + this.offsetTop + 2;
						iframe.style.left = ulSub.offsetLeft  + this.offsetLeft;
					}
					iframe.style.width = ulSub.scrollWidth;
					iframe.style.height = ulSub.clientHeight;
					iframe.style.display = "inline";				
				} //if submenu.length
			} //mouseover
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				document.getElementsByClassName("menu_iframe").each(function(node) {
					node.style.display = "none";
				});
			} //mouseout
		} //for
	} //sfHover
	if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>
</script>

以上是关于JavaScript suckerfish的儿子下载IE修复的主要内容,如果未能解决你的问题,请参考以下文章

JavaScript SuckerFish Fade

JavaScript Suckerfish Drop-Down Menus,jQuery风格

CSS Joomla 1.5的suckerfish下拉菜单joomla 1.5教程

javascript如何阻止事件冒泡和默认行为

这是啥 CSS 规则?

javaScript基础入门篇