createPopup样式问题 应该可以吧,对当前页面的style进行循环,在createPopup中循环创建 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE> New Document </TITLE><META NAME="Generator" CONTENT="EditPlus"><META NAME="Author" CONTENT=""><META NAME="Keywords" CONTENT=""><META NAME="Description" CONTENT=""><script language="javascript" type="text/JavaScript">//初始化一个oPopup对象var oPopup = window.createPopup();//这两个是获得表格绝对位置的方法,很有用的说function getLeftIE(x,m) { var dx=0; if (x.tagName=="TD"){ dx=x.offsetLeft; } else if (x.tagName=="TABLE") { dx=x.offsetLeft; if (m) { dx+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; } } return dx+(x.parentElement.tagName=="BODY"?0:getLeftIE(x.parentElement,m));}function getTopIE(x,m) { var dy=0; if (x.tagName=="TR"){ dy=x.offsetTop; } else if (x.tagName=="TABLE") { dy=x.offsetTop; if (m) { dy+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; } } return dy+(x.parentElement.tagName=="BODY"?0:getTopIE(x.parentElement,m));}//显示菜单function ButtonClick(node,t){ alert("123"); //首先得到鼠标所在的表格的位置 var left = getLeftIE(node,true)-8; var top = getTopIE(node,true);//定义打开的oPopup的宽度,高度 // var width = 90; // var height = MenuText[t].length*20; var width = 400; var height = 100; //清空oPopup的内容,否则每次调用都只会在后面接着写 oPopup.document.body.innerHTML = ""; var b=document.getElementById("table1").innerHTML.toString(); alert(b); alert(document.getElementById("table1").innerText.toString()); var c=document.getElementById("table1").innerText.toString(); var oPopBody = oPopup.document.body; oPopup.show(left,top, width, height, document.body); oPopup.document.open;//让oPopup在鼠标离开时自动隐藏。 oPopup.document.write("<body leftmargin=0 topmargin=0 scroll=no style='border : 0 px;bgColor:#cccccc' onmouseover=clearTimeout(parent.popt); onmouseout=parent.popt=setTimeout('parent.oPopup.hide()',10);>");//用document.write()写菜单内容 //oPopup.document.write("<table width=100% height=100% style='border-collapse : collapse;'>"); //for(var i=0;i<MenuText[t].length;i++) //{ //oPopup.document.write("<tr><td background='image/topbg.gif' bgcolor=#cccccc style='border-top : #cccccc //1px solid;border-bottom : #666666 1px solid;border-left : #cccccc 1px solid;border-right : #666666 1px //solid;mouse : hand; font-size : 12px; color:#000000;text-align : left;vertical-align : center;CURSOR: //hand' onmouseover=this.bgColor='#C2D2E5'; onmouseout=this.bgColor='#cccccc'; height='20' //onclick='parent.parent.main.location.href=\""+MenuEven[t][i]+"\"';>"+MenuText[t][i]+"</td></tr>"); //} oPopup.document.write("</table></td></tr></table>"); //alert("nnnnn") oPopup.document.write("<table>"); oPopup.document.write(b); oPopup.document.write("<tr><td>3333</td></tr>"); oPopup.document.write("</table>"); // alert("mmmm") oPopup.document.write("</body>")}</script></HEAD><BODY><table><tr><td align="left" onclick="ButtonClick(this,1)">菜单1</td></tr><br><tr><td height="200"></td></tr><br></table><table id="table1"><tr><td align="left" >菜单3</td></tr><br><tr><td align="left" style="color:red" >菜单4</td></BODY></HTML> var ss = pop.document.createStyleSheet();ss.addRule("div", "background-color: blue"); //自己加样式定义呀 但如果换成这样写的话就没有效果var ss = oPopup.document.createStyleSheet();ss.href="/CSS/EditorStyle.css"; Extjs tree获取所有叶子 这种网址不能进行网页收藏,真怪,有什么方法? 一个在FF中能运行,却在IE中报参数无效错误! 图 片 显 示 o n e r r or 的问题啊! 用iframe怎么实现对其src的页面付值 兼容性问题 关于JS变量类型的问题(数组和字符串),在线等 javascript中怎样保持上一次操作的状态?我急啊,怎么也搞不定。在线等 怎么解决这个bug 微信小程序的问题 谁能帮我改写一下这个js 谢谢了 在线等 如何用javascript实现窗口“最小化”功能
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript" type="text/JavaScript">
//初始化一个oPopup对象var oPopup = window.createPopup();//这两个是获得表格绝对位置的方法,很有用的说
function getLeftIE(x,m) {
var dx=0;
if (x.tagName=="TD"){
dx=x.offsetLeft;
}
else if (x.tagName=="TABLE") {
dx=x.offsetLeft;
if (m) { dx+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
}
return dx+(x.parentElement.tagName=="BODY"?0:getLeftIE(x.parentElement,m));
}
function getTopIE(x,m) {
var dy=0;
if (x.tagName=="TR"){
dy=x.offsetTop;
}
else if (x.tagName=="TABLE") {
dy=x.offsetTop;
if (m) { dy+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
}
return dy+(x.parentElement.tagName=="BODY"?0:getTopIE(x.parentElement,m));
}//显示菜单
function ButtonClick(node,t)
{ alert("123");
//首先得到鼠标所在的表格的位置
var left = getLeftIE(node,true)-8;
var top = getTopIE(node,true);
//定义打开的oPopup的宽度,高度
// var width = 90;
// var height = MenuText[t].length*20;
var width = 400;
var height = 100;
//清空oPopup的内容,否则每次调用都只会在后面接着写
oPopup.document.body.innerHTML = "";
var b=document.getElementById("table1").innerHTML.toString();
alert(b);
alert(document.getElementById("table1").innerText.toString());
var c=document.getElementById("table1").innerText.toString();
var oPopBody = oPopup.document.body;
oPopup.show(left,top, width, height, document.body);
oPopup.document.open;
//让oPopup在鼠标离开时自动隐藏。
oPopup.document.write("<body leftmargin=0 topmargin=0 scroll=no style='border : 0 px;bgColor:#cccccc' onmouseover=clearTimeout(parent.popt); onmouseout=parent.popt=setTimeout('parent.oPopup.hide()',10);>");//用document.write()写菜单内容
//oPopup.document.write("<table width=100% height=100% style='border-collapse : collapse;'>");
//for(var i=0;i<MenuText[t].length;i++)
//{
//oPopup.document.write("<tr><td background='image/topbg.gif' bgcolor=#cccccc style='border-top : #cccccc //1px solid;border-bottom : #666666 1px solid;border-left : #cccccc 1px solid;border-right : #666666 1px //solid;mouse : hand; font-size : 12px; color:#000000;text-align : left;vertical-align : center;CURSOR: //hand' onmouseover=this.bgColor='#C2D2E5'; onmouseout=this.bgColor='#cccccc'; height='20' //onclick='parent.parent.main.location.href=\""+MenuEven[t][i]+"\"';>"+MenuText[t][i]+"</td></tr>");
//}
oPopup.document.write("</table></td></tr></table>");
//alert("nnnnn")
oPopup.document.write("<table>");
oPopup.document.write(b);
oPopup.document.write("<tr><td>3333</td></tr>");
oPopup.document.write("</table>");
// alert("mmmm")
oPopup.document.write("</body>")
}
</script>
</HEAD><BODY>
<table>
<tr>
<td align="left" onclick="ButtonClick(this,1)">菜单1</td>
</tr>
<br>
<tr>
<td height="200">
</td>
</tr>
<br>
</table>
<table id="table1">
<tr>
<td align="left" >菜单3</td>
</tr>
<br>
<tr>
<td align="left" style="color:red" >菜单4</td>
</BODY>
</HTML>
ss.addRule("div", "background-color: blue"); //自己加样式定义呀
var ss = oPopup.document.createStyleSheet();
ss.href="/CSS/EditorStyle.css";