<script language="JavaScript" copyright="qq747285250">
function huahua(){
var kym=document.createElement("div");
kym.style.position="absolute";
kym.style.left=window.event.clientX+"px";
kym.style.top=window.event.clientY+"px";
kym.style.backgroundColor="#000000";
kym.innerHTML="。";
document.body.appendChild(kym);}
document.onmousedown=function(){document.onmousemove=huahua};document.onmouseup=function(){document.onmousemove=function huahua(){return true}}</script>呵呵,是自学的啊,没有老师教,没有看书,记得我么,我就是之前在这里提问了N个问题的菜鸟,现在对javascript的认识深了啊,呵呵呵呵呵(自豪中)

解决方案 »

  1.   

    更新了一下
    <script language="JavaScript" copyright="qq747285250">
    function huahua(){
    var kym=document.createElement("div");
    kym.style.position="absolute";
    kym.style.left=window.event.clientX+"px";
    kym.style.top=window.event.clientY+"px";
    kym.style.width="1px";
    kym.style.height="1px";
    kym.innerHTML="#";
    document.body.appendChild(kym);}
    document.onmousedown=function(){document.onmousemove=huahua};document.onmouseup=function(){document.onmousemove=function huahua(){return true}}</script>
      

  2.   

    FF 事件对象不一样
    function huahua(e){
      e = e || window.event;
      if(document.all){
        kym.style.left=e.clientX + document.body.scrollLeft +"px";
        kym.style.top=e.clientX+ document.body.scrollTop + "px";
      }else{
        kym.style.left=e.pageX+"px";
        kym.style.top=e.pageY+"px";
      }
    }
      

  3.   


    14岁? 你可以下山了首先window.event是在IE中才有效的。
    document.body 也要换成 document.documentElement还有比如添加文档事件也应该用 专门的 绑定方法
      

  4.   

    还有方法的名字,你就弄了个画画,不会用下 Draw 什么的吗?