insertRow()插入的动态表格激发的onmouseover 能alert出来东西却不能改变动态表格行的颜色。是怎么回事情 event.srcElement.parentElement.style.backgroundColor=\'blue\';}); 改成event.srcElement.style.backgroundColor=\'blue\';}); 看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 nowTR.attachEvent('onmouseover',function(){event.srcElement.parentElement.style.backgroundColor='blue';}); nowTR.attachEvent('onmouseout',function(){event.srcElement.parentElement.style.backgroundColor='';}); 我刚开始的就是这样的啊可是说缺少对象他有个<iframe 里面的表格<table id="game_table" width="730" border="0" cellspacing="1" cellpadding="0" class="b_tab" > <tr class="b_tline_ft"> <td width="80" ></td> </tr> </table> 在iframe里面的<frameset rows="0,*" frameborder="NO" border="0" framespacing="0"> <frame name="body_var" noresize src="body_var.php"> 以上的表格在这个body_var.php里面 nowTR.attachEvent('onmouseover',function(){event.srcElement.parentElement.style.backgroundColor='blue';}); nowTR.attachEvent('onmouseout',function(){event.srcElement.parentElement.style.backgroundColor='';}); 这部分在index.php里面index.php里面包含的<iframe。 这样写说缺少对象。。是不是function要传递过去才可以前面部分代码如下function ShowData_OU(obj_table,GameData,data_amount) { var nowLeague = \'\'; var nowDate = \'\'; with(obj_table) { //睲埃table戈 while(rows.length > 1) deleteRow(rows.length-1); //秨﹍陪ボ秨い辽祘戈 for(i=0; i<data_amount; i++) { // if(GameData[i][9]<=0 || GameData[i][10]<=0)GameData[i][8]=\'\'; //耞羛幅琌ぃ陪ボ羛幅 gdate = GameData[i][1].substr(0,5);// if (document.getElementById("sel_lid").value){// if(document.getElementById("sel_lid").value != GameData[i][2]) continue;// } if(nowLeague != GameData[i][2] || nowDate != gdate) { nowLeague = GameData[i][2]; nowDate = gdate; nowTR = insertRow(); with(nowTR) { nowTD = insertCell(); nowTD.colSpan = 14; nowTD.className = \'b_hline\'; var lsys="#daff00"; var lyjd=GameData[i][2]; var lsysw="'; echo $langx; echo '"; rooot = source.documentElement; sortField=rooot.selectNodes("//w[" + lsysw + " = \'" + lyjd + "\']"); if(sortField.length>0) { lsys=sortField[0].selectSingleNode("cl").text; } nowTD.style.cssText="background-color:" + lsys + ";cursor:default;"; nowTD.innerHTML = GameData[i][2]; } } nowTR = insertRow(); nowTR.className = \'b_cen\'; //alert(document.getElementsByTagName("tr")); //if(nowTR.onmouseover) // if( nowTR.attachEvent("onmouseover",aa)) // {nowTR.style.cssText="background-Color:#008000"; } //nowTR.style.cssText="background-Color:#008000"; nowTR.attachEvent(\'onmouseover\',function(){event.srcElement.parentElement.style.backgroundColor=\'blue\';}); nowTR.attachEvent(\'onmouseout\',function(){event.srcElement.parentElement.style.backgroundColor=\'\';});obj_table是传递过来表格的id gamedate是数据。。 全文太长。贴不了。。你加我下好吗。。我的QQ 906426 msn [email protected] 谢谢 你把js方再frame的网页内的页面上或是你加328218816再QQ上说 试试this.style.backgroundColor=\'blue\' 为什么字符串要用\'abc\'之类?直接用"abc"或者'abc'不可以? 使用Jquery实现拖动效果,妖求是user1从A组的用户拖动到另外B组去,拖动之后user1成为B组的用户,同时从B组消失, 关于URL重定向问题。 求助:关于flash 播放器 大家帮忙啊`!!! js获取键值(来者有分) javascript里页面元素哪些可以new生成 js取得绝对路径 一个简单的问题,动态添加的表格中如何实现下拉列表? 这样的功能怎样实现?(关于按钮提交的) 麻烦各位高手们,问个问题我。 大家帮助看一下。这个邮箱为什么进不去。(高手来看一下。(急急)在线等 JS里有没有清屏的函数? JS的好手门帮个忙
nowTR.attachEvent('onmouseout',function(){event.srcElement.parentElement.style.backgroundColor='';});
可是说缺少对象
他有个<iframe 里面的表格
<table id="game_table" width="730" border="0" cellspacing="1" cellpadding="0" class="b_tab" >
<tr class="b_tline_ft">
<td width="80" ></td>
</tr>
</table> 在iframe里面的<frameset rows="0,*" frameborder="NO" border="0" framespacing="0">
<frame name="body_var" noresize src="body_var.php"> 以上的表格在这个body_var.php里面 nowTR.attachEvent('onmouseover',function(){event.srcElement.parentElement.style.backgroundColor='blue';});
nowTR.attachEvent('onmouseout',function(){event.srcElement.parentElement.style.backgroundColor='';}); 这部分在index.php里面
index.php里面包含的<iframe
。
前面部分代码如下
function ShowData_OU(obj_table,GameData,data_amount)
{
var nowLeague = \'\';
var nowDate = \'\';
with(obj_table)
{
//睲埃table戈
while(rows.length > 1)
deleteRow(rows.length-1);
//秨﹍陪ボ秨い辽祘戈
for(i=0; i<data_amount; i++)
{
// if(GameData[i][9]<=0 || GameData[i][10]<=0)GameData[i][8]=\'\'; //耞羛幅琌ぃ陪ボ羛幅
gdate = GameData[i][1].substr(0,5);
// if (document.getElementById("sel_lid").value){
// if(document.getElementById("sel_lid").value != GameData[i][2]) continue;
// } if(nowLeague != GameData[i][2] || nowDate != gdate)
{
nowLeague = GameData[i][2];
nowDate = gdate;
nowTR = insertRow();
with(nowTR)
{
nowTD = insertCell();
nowTD.colSpan = 14;
nowTD.className = \'b_hline\';
var lsys="#daff00";
var lyjd=GameData[i][2];
var lsysw="';
echo $langx;
echo '";
rooot = source.documentElement;
sortField=rooot.selectNodes("//w[" + lsysw + " = \'" + lyjd + "\']");
if(sortField.length>0)
{
lsys=sortField[0].selectSingleNode("cl").text;
}
nowTD.style.cssText="background-color:" + lsys + ";cursor:default;";
nowTD.innerHTML = GameData[i][2];
}
}
nowTR = insertRow();
nowTR.className = \'b_cen\';
//alert(document.getElementsByTagName("tr"));
//if(nowTR.onmouseover)
// if( nowTR.attachEvent("onmouseover",aa))
// {nowTR.style.cssText="background-Color:#008000"; }
//nowTR.style.cssText="background-Color:#008000";
nowTR.attachEvent(\'onmouseover\',function(){event.srcElement.parentElement.style.backgroundColor=\'blue\';});
nowTR.attachEvent(\'onmouseout\',function(){event.srcElement.parentElement.style.backgroundColor=\'\';});
obj_table是传递过来表格的id gamedate是数据。。
或是你加328218816再QQ上说
this.style.backgroundColor=\'blue\'