动态设置onmousein不作用 onmousein??你的意思是需要触发onmousemove事件?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 创建带参事件的时候 要有一个匿名函数img.setAttribute("onmouseover",function(){menuMouseOut(img.id)}); 另外一个问题没研究过。。 换种方式img.onmouseout = function(){ menuMouseOut(this.id);};img.onmouseover = function(){ menuMouseIn(this.id);}; 以上几种方式都不作用啊.再把我的具体环境说下:<body onload = "onpageload()">//============================/* JS.JS文件*/function onpageload(){ setImgEvent();}function setImgEvent(){//在这里动态添加标签的两个鼠标事件,但是不起作用..} 是不是这个效果??<style type="text/css">.xx{ border:3px solid #FF6600;}.oo{boder:0px}</style><script>function onpageload(){setImgEvent()}function setImgEvent() {var img=document.getElementById("img")img.attachEvent("onmouseover", function(){show("xx")})img.attachEvent("onmouseout", function(){hidde("oo")})}function show(e){document.getElementById("img").className=e}function hidde(e){document.getElementById("img").className=e}</script><body onload="onpageload()"><img id="img" src="http://img1.qq.com/news/pics/13403/13403344.jpg" width="310" height="210"> </body> 事件源丢失!如果是已填加成功!会报语法错误的!没有onmousein事件:onmouseout,onmouseover var Img = document.getElementById"img_1"); 呵呵var Img = document.getElementById("img_1"); 谢谢各位,结贴了.function initMenuEvent(){ var arrayImg = document.getElementsByTagName("img"); var img= null; for (var i=0;i<arrayImg.length;i++) { img = arrayImg[i]; if (img.id.substr(0,4) == "imgm") { img.onmouseout = function(){menuMouseOut(this.id);}; img.onmouseover = function(){menuMouseOver(this.id);}; } } }//以上语句成功,onmousein 事件不存在.但是当把this.id换成 img.id,运行却抱错:错误的参数.不知道为什么 求高手js 修改代码 a标记的使用 怎么弄 请大侠们看看这个JS脚本,这个JS脚本在IE与firefox下显示的问题 常数中有换行符 急求:如何用下拉框传两个值??? 一个奇怪的触发问题,大家进来看看 求一代码,一个页面可以放几个操作界面,重叠着,分别点击顶端的标题就可以切换的 如何制作一个类似框架能动态改变地表格的单元格的大小的表格? 请问怎么修改默认主页? 怎么做这种javascript控件啊,急!! 怎么换作用vbscript 这句话就显示不出来了
img.setAttribute("onmouseover",function(){menuMouseOut(img.id)});
另外一个问题没研究过。。
menuMouseOut(this.id);
};
img.onmouseover = function(){
menuMouseIn(this.id);
};
<body onload = "onpageload()">
//============================
/* JS.JS文件*/function onpageload()
{
setImgEvent();
}
function setImgEvent()
{
//在这里动态添加标签的两个鼠标事件,但是不起作用..
}
<style type="text/css">
.xx{ border:3px solid #FF6600;}
.oo{boder:0px}
</style>
<script>
function onpageload(){
setImgEvent()
}function setImgEvent() {
var img=document.getElementById("img")
img.attachEvent("onmouseover", function(){show("xx")})
img.attachEvent("onmouseout", function(){hidde("oo")})
}function show(e){
document.getElementById("img").className=e
}
function hidde(e){
document.getElementById("img").className=e
}
</script>
<body onload="onpageload()">
<img id="img" src="http://img1.qq.com/news/pics/13403/13403344.jpg" width="310" height="210">
</body>
var Img = document.getElementById("img_1");
function initMenuEvent()
{
var arrayImg = document.getElementsByTagName("img");
var img= null;
for (var i=0;i<arrayImg.length;i++)
{
img = arrayImg[i];
if (img.id.substr(0,4) == "imgm")
{
img.onmouseout = function(){menuMouseOut(this.id);};
img.onmouseover = function(){menuMouseOver(this.id);};
}
}
}
//以上语句成功,onmousein 事件不存在.
但是当把this.id换成 img.id,运行却抱错:错误的参数.不知道为什么