onmousein??
你的意思是需要触发onmousemove事件??

解决方案 »

  1.   

    创建带参事件的时候  要有一个匿名函数
    img.setAttribute("onmouseover",function(){menuMouseOut(img.id)}); 
    另外一个问题没研究过。。
      

  2.   

    换种方式img.onmouseout = function(){
        menuMouseOut(this.id);
    };
    img.onmouseover = function(){
        menuMouseIn(this.id);
    };
      

  3.   

    以上几种方式都不作用啊.再把我的具体环境说下:
    <body onload = "onpageload()">
    //============================
    /* JS.JS文件*/function onpageload()
    {
      setImgEvent();
    }
    function setImgEvent()
    {
    //在这里动态添加标签的两个鼠标事件,但是不起作用..
    }
      

  4.   

    是不是这个效果??
    <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>
      

  5.   

    事件源丢失!如果是已填加成功!会报语法错误的!没有onmousein事件:onmouseout,onmouseover
      

  6.   

    var Img = document.getElementById"img_1"); 呵呵
    var Img = document.getElementById("img_1"); 
      

  7.   

    谢谢各位,结贴了.
    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,运行却抱错:错误的参数.不知道为什么