框架优先级高于层,createPopup创建的窗口优先级高于框架,因此可以用它实现不被框架挡住的菜单。
代码示例如下:
<HTML> <HEAD> <SCRIPT LANGUAGE="JScript"> var oPopup = window.createPopup(); function showMenu() { var oPopBody = oPopup.document.body; oPopBody.style.backgroundColor = "lightyellow"; oPopBody.style.border = "solid black 1px"; str="<table>"; str+="<tr><td οnclick=parent.window.open('http://www.163.com')>163</td></tr>"; str+="<tr><td οnclick="+"alert('dd');alert('ee');"+">163333</td></tr>"; str+="</table>"; oPopBody.innerHTML=str; oPopup.show(50, 50, 180, 50, document.body); } </SCRIPT> </HEAD> <BODY> <BUTTON οnclick="showMenu()">菜单</BUTTON> </BODY> </HTML>