<script language="javascript">
function tr_onmouseover(e){e=e||event;var td_obj = document.getElementById(e.id+"1");td_obj.innerHTML="<a href='http://www.sohu.com'>搜狐</a>";//e.style.background = 'red';document.getElementById("t2").innerHTML=e.id;
}
</script>
<div id='move_div00' class='move_div' dragableBox='true'><table><tr class='t' id='tr_control00' onmouseover='tr_onmouseover(this);' ><td id='tr_control001' valign=top></td></tr><tr><td valign=bottom ><a href='aa.htm'>00</a></td></tr></table></div>用这个方法产生的搜狐连接无法点击,是什么原因呢?00的连接aa.htm就可以点击
function tr_onmouseover(e){e=e||event;var td_obj = document.getElementById(e.id+"1");td_obj.innerHTML="<a href='http://www.sohu.com'>搜狐</a>";//e.style.background = 'red';document.getElementById("t2").innerHTML=e.id;
}
</script>
<div id='move_div00' class='move_div' dragableBox='true'><table><tr class='t' id='tr_control00' onmouseover='tr_onmouseover(this);' ><td id='tr_control001' valign=top></td></tr><tr><td valign=bottom ><a href='aa.htm'>00</a></td></tr></table></div>用这个方法产生的搜狐连接无法点击,是什么原因呢?00的连接aa.htm就可以点击
再不行, 用firebug 看生成的 td_obj.innerHTML="<a href='http://www.sohu.com'>搜狐</a>";
这里看到底是啥
link.href = "http://www.sohu.com";
link.innerHTML = "搜狐";
td_obj.appendChild(link);
用这个试试
停止冒泡就行,好象是e.cancelBubble = true;这个加在搜狐链接上
因为,onmouseover不停在产生,不停地产生新的连接,所以阻挡了点击动作,中间应该有间隙,可能的毫秒级,你根本点不了。
找个土办法解决,
if (td_obj.innerHTML=="") {td_obj.innerHTML="<a href='aa.htm'>搜狐</a>";}不产生新的连接就可以点击了。e.cancelBubble = true; 应该是思路对的,可试了不行,有什么语句可以停止 这个id的
onmouseover动作,然后在 onmouseout 时恢复 onmouseover ?
td_obj.onmouseover = function(){};}
但是过会搜狐连接也没有了,还是图办法管用。