<map name="Map" id="Map"><area shape="rect" id="a0" coords="528,612,608,642" style="cursor:help" href="#temp" />
<area shape="rect" id="a1" coords="680,645,760,675" style="cursor:help" href="#temp" />
<area shape="rect" id="a2" coords="522,484,602,514" style="cursor:help" href="#temp" />
<area shape="rect" id="a3" coords="715,585,795,615" style="cursor:help" href="#temp" />
<area shape="rect" id="a4" coords="653,515,733,545" style="cursor:help" href="#temp" />
<area shape="rect" id="a5" coords="689,489,769,519" style="cursor:help" href="#temp" />
<area shape="rect" id="a6" coords="303,675,383,705" style="cursor:help" href="#temp" />
<area shape="rect" id="a7" coords="438,543,518,573" style="cursor:help" href="#temp" />
<area shape="rect" id="a8" coords="368,520,448,550" style="cursor:help" href="#temp" />
<area shape="rect" id="a9" coords="385,665,465,695" style="cursor:help" href="#temp" />
<area shape="rect" id="a10" coords="350,783,430,813" style="cursor:help" href="#temp" /></map>
我想让a0至a5在触发一个事件时生效我想让a6至a10在触发另一个事件时生效不触发事件不生效该怎么办好
<area shape="rect" id="a1" coords="680,645,760,675" style="cursor:help" href="#temp" />
<area shape="rect" id="a2" coords="522,484,602,514" style="cursor:help" href="#temp" />
<area shape="rect" id="a3" coords="715,585,795,615" style="cursor:help" href="#temp" />
<area shape="rect" id="a4" coords="653,515,733,545" style="cursor:help" href="#temp" />
<area shape="rect" id="a5" coords="689,489,769,519" style="cursor:help" href="#temp" />
<area shape="rect" id="a6" coords="303,675,383,705" style="cursor:help" href="#temp" />
<area shape="rect" id="a7" coords="438,543,518,573" style="cursor:help" href="#temp" />
<area shape="rect" id="a8" coords="368,520,448,550" style="cursor:help" href="#temp" />
<area shape="rect" id="a9" coords="385,665,465,695" style="cursor:help" href="#temp" />
<area shape="rect" id="a10" coords="350,783,430,813" style="cursor:help" href="#temp" /></map>
我想让a0至a5在触发一个事件时生效我想让a6至a10在触发另一个事件时生效不触发事件不生效该怎么办好
解决方案 »
- 录求一段像163网易首页那样的折叠页面代码,谢谢
- extjs4.0 树 复选框
- 用户输入6个数字,我能不能把他的前4位自动转换成年,5,6位转换成月,7,8位自动付这一年月的最后一天?大家帮帮我呀,所有分都拿出来了
- 如何使用javascript操作下拉框,实现动态增加删除。
- 验证输入分数,得分分配的js封装 验证 大神快现身
- 如何实现字幕的淡入淡出效果???(javascript)
- 为什么我的javascript代码在网面里运行正常,可如果用<script src="asdf.js" language="javascript></script>就不行了?
- 菜鸟问题:如何实现弹出对话框“确认”“取消”,在线等待
- 很低級問題﹐請都看看
- 高分求救:如何用Javascript或Vbscript在客户端显示数据库(储存在本机硬盘里的数据库)?
- 急!js窗体问题
- Javascript事件问题,帮忙给个思路!
<map name="Map" id="Map">
</map>1.触发事件时动态生成Dom ao-a5添加到Map中2.触发另一事件时动态生成Dom a6-a10添加到Map中
当A事件为以下:
function a()
{
for(var i=0;i<6;i++)
document.getElementById("id"+i).style.visilibity="";
}
事件B同理
试下。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>热点操作</title>
<script type="text/javascript">
function $(sId){
return document.getElementById(sId);
}function enableArea1(){
var oMap=$("Map");
var oArea=document.createElement("area");
oArea.setAttribute("shape","rect");
oArea.setAttribute("coords","160,33,288,83");
oArea.setAttribute("href","javascript:alert(1);");
oMap.appendChild(oArea);
}function enableArea2(){
var oMap=$("Map");
var oArea=document.createElement("area");
oArea.setAttribute("shape","circle");
oArea.setAttribute("coords","196,172,53");
oArea.setAttribute("href","javascript:alert(2);");
oMap.appendChild(oArea);
}
</script>
</head>
<body>
<input type="button" value="启用热点1" onclick="enableArea1();"/>
<input type="button" value="启用热点1" onclick="enableArea2();"/>
<br/>
<img src="http://www.gojx.com/xin/UploadPic/2005-12/20051215114157364.JPG" border="0" usemap="#Map"/>
<map name="Map" id="Map">
</map>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>热点操作</title>
<script type="text/javascript">
function $(sId){
return document.getElementById(sId);
}function enableArea1(){
var oMap=$("Map");
var oArea=document.createElement("area");
oArea.setAttribute("shape","rect");
oArea.setAttribute("coords","160,33,288,83");
oArea.setAttribute("href","javascript:alert(1);");
oMap.appendChild(oArea);
}function enableArea2(){
var oMap=$("Map");
for(var i=oMap.childNodes.length-1;i>=0;i--) oMap.removeChild(oMap.childNodes[i]);//删除所有热点
var oArea=document.createElement("area");
oArea.setAttribute("shape","circle");
oArea.setAttribute("coords","196,172,53");
oArea.setAttribute("href","javascript:alert(2);");
oMap.appendChild(oArea);
}
</script>
</head>
<body>
<input type="button" value="启用热点1" onclick="enableArea1();"/>
<input type="button" value="启用热点1" onclick="enableArea2();"/>
<br/>
<img src="http://www.gojx.com/xin/UploadPic/2005-12/20051215114157364.JPG" border="0" usemap="#Map"/>
<map name="Map" id="Map">
</map>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>热点操作</title>
<script type="text/javascript">
function $(sId){
return document.getElementById(sId);
}function enableArea1(){
var oMap=$("Map");
var oArea=document.createElement("area");
oMap.innerHTML="";
oArea.setAttribute("shape","rect");
oArea.setAttribute("coords","160,33,288,83");
oArea.setAttribute("href","javascript:alert(1);");
oMap.appendChild(oArea);
}function enableArea2(){
var oMap=$("Map");
var oArea=document.createElement("area");
oMap.innerHTML="";
oArea.setAttribute("shape","circle");
oArea.setAttribute("coords","196,172,53");
oArea.setAttribute("href","javascript:alert(2);");
oMap.appendChild(oArea);
}
</script>
</head>
<body>
<input type="button" value="启用热点1" onclick="enableArea1();"/>
<input type="button" value="启用热点2" onclick="enableArea2();"/>
<br/>
<img src="http://www.gojx.com/xin/UploadPic/2005-12/20051215114157364.JPG" border="0" usemap="#Map"/>
<map name="Map" id="Map">
</map>
</body>
</html>
消除链接的方法这样的简单lihui_shine,已经另一贴里给了分,谢谢再次谢谢