- 论坛徽章:
- 0
|
以下代码可以在ie中实现,但是firefox中不行
- <script>
- ......
- function add(domainid)
- {
- document.getElementsByName("newip_"+domainid)[0].value="";
-
- var objtmp=document.getElementById("div_"+domainid)
- with(objtmp.style)
- {
- mX=event.x?event.x:event.pageX;
- alert(1);
- left = (event.clientX +10+ document.body.scrollLeft) + "px";
- top = (event.clientY +5+ document.body.scrollTop) + "px";
- display = "";
- }
- document.getElementsByName("newip_"+domainid)[0].focus();
- }
- </script>
- ......
- <td width="77"><span style="display: "><a href="#" onclick="add('685');return false;"><font color="#7899DC">添加新IP</font></a></span></td>
- <td width="4%" align="right"><a href="#" onclick="edit(this,0,685,'1.1.1.1');return false;">编辑</a></td>
- <td width="4%" align="right"><a href="#" onclick="del(this,0,685);return false;">删除</a></td>
- </tr>
- </table>
- <div style="position:absolute; display:none; border: 1px solid black; background-color:#F7F7F7;" id="div_685">
- <table>
- <tr><td colspan="2">
- <input type="text" name="newip_685" onkeydown="if (event.keyCode == 13) {addipsub(651);}">
- </td></tr>
- <tr><td align="center">
- <input type="button" value="确定" onclick="addipsub(685);"></td><td align="center"><input type="button" value="取消" onclick="caladd('685');">
- </td></tr>
- </table>
- </div>
复制代码
google发现 mX=event.x?event.x:event.pageX;
这个实现不了 |
|