请问我要点右键的时候弹出菜单,为什么不正确,谢谢,在线等候

azxsqw 2003-10-28 09:32:45
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script language="JavaScript">
var x,y,strHtml;
function mouseEvent(){
x = event.clientX;
y = event.clientY;
}
function isIE(){
if(document.all){
return true;
}else{
return false;
}
}
function showButton()[
var isButton;
if(isIE){
if(event.button == 2 || event.button == 3){
isButton = true;
}else{
isButton = false;
}
}
return isButton;
}
function drawHtml(){
strHtml = "<table width=\"13%\" border=\"0\" style=\"background-color:red\"><tr> <td width=\"18%\"> </td><td width=\"82%\">ba</td></tr></table>" ;
}
function innt()[
mouseEvent();
if(showButton()){
drawHtml();
document.all[pop].innerText = strHtml;
document.all[pop].style.display = "block";
document.all[pop].style.left = x ;
document.all[pop].style.top = y;
}
}
document.onClick = innt();
</script>
<body>
<div id="pop" style="display:none"></div>
</body>
</html>
...全文
45 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingdomzhf 2003-10-28
  • 打赏
  • 举报
回复
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<script language="JavaScript">
var x,y,strHtml;
function mouseEvent(){
x = event.clientX;
y = event.clientY;
}
function isIE(){
if(document.all){
return true;
}else{
return false;
}
}
function showButton(){
var isButton;
if(isIE()){
if(event.button == 2 || event.button == 3){
isButton = true;
}else{
isButton = false;
}
}
return isButton;
}
function drawHtml(){
strHtml = "<table width=\"13%\" border=\"0\" style=\"background-color:red\"><tr> <td width=\"18%\"> </td><td width=\"82%\">ba</td></tr></table>" ;
}
function innt(){

mouseEvent();

if(showButton()){
drawHtml();

document.all('pop').innerHTML = strHtml;
document.all('pop').style.display = "block";
document.all('pop').style.left = x ;
document.all('pop').style.top = y;
}
}

document.body.onmousedown = innt;

</script>
<div id="pop" style="display:none"></div>
</body>
</html>

87,987

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧