本帖最后由 huangwenquan123 于 2011-07-11 16:42:09 编辑

解决方案 »

  1.   


     <div style="width:100px;height:100px;border:1px solid red;position:absolute;z-index:200;cursor:move;" id="div"></div>
        <script type="text/javascript">
            document.getElementById("div").onclick=function(){
                alert("aa");
            }
        </script>=》
     <div style="width:100px;height:100px;border:1px solid red;position:absolute;z-index:200;cursor:move;" id="div"></div>
        <script type="text/javascript" defer>
            document.getElementById("div").onclick=function(){
                alert("aa");
            }
        </script>
    defer
      

  2.   

    楼主,div中没有内容的时候,就像一个没底部的盆子,你点边框的时候肯定会触发你的onclick事件。等你加了背景色的时候,相当于一个盆子有底了。你可以点击到它底部。
      

  3.   

    额 木有装ie9,没想到ie9可以
    在ie 6 7 8都不行
      

  4.   


    IE8chrome 12FF5表示毫无压力LZ用的什么浏览器啊
      

  5.   

    IE9  chrome  ff 测试木有问题
      

  6.   

    在IE9中选择兼容模式 IE7 IE8 都可以点到 
      

  7.   

    额 我用ie7不可以点到
    然后用ietest测试6 7 8也不可以点到!
      

  8.   

    不是其他因素影响了
    我单独创建了个页面,还是点不到欲哭无泪!<!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>
        <title>无标题页</title>
    </head>
    <body>
        <div style="width:100px;height:100px;border:1px solid red;position:absolute;z-index:200;cursor:move;" id="div"></div>
        <script type="text/javascript" defer>
            document.getElementById("div").onclick=function(){
                alert("aa");
            }
        </script>
    </body>
    </html>
      

  9.   

     <div style="width:100px;height:100px;border:1px solid red;z-index:200;cursor:move;" id="divv"></div>
        <script type="text/javascript">
            document.getElementById("divv").onclick=function(){
                alert("aa");
            }
        </script>
      

  10.   

    IE9,chrome12,Safari,opera,firefox 表示毫无鸭梨
      

  11.   


    这绝对定位是不会影响到你的点击的。。你这只能用RP来解释了我这里能用的浏览器都用了都没问题。。你按19楼的。。把div这个ID改一下看看。。叫个div123也比叫个好。。不过这应该也不是问题
      

  12.   

    改了id还是一样。
    难道真的是RP问题?我去掉绝对定位就可以点击得到
    不去掉的话就只能在边框才点击得到
      

  13.   

    IE6,IE7点不到,IE8点的到,去掉绝对定位,三个都可以
      

  14.   

    我之前是在IE8下试的,JS报错了,所以我加上了 defer#18在我这里是好用的
      

  15.   

    LZ....不得不说。
    RPWT啦哈哈哈哈~
      

  16.   

    我的是ie8 测试不好使:
    错误: 'document.getElementById(...)' 为空或不是对象在div中间加上任意字符后错误消失!
      

  17.   

    楼主,div中没有内容的时候,就像一个没底部的盆子,你点边框的时候肯定会触发你的onclick事件。等你加了背景色的时候,相当于一个盆子有底了。你可以点击到它底部。
      

  18.   

    就是鼠标点击没反应,还有设置了cursor:move属性,按理说移进去光标会变,可是移进去鼠标还是那个箭头
      

  19.   

    <div style="height:100px;">
        <div style="width:100px;height:100px;border:1px solid red;position:absolute;cursor:move;" id="divv"></div>
        <script type="text/javascript">
            document.getElementById("divv").onclick=function(){
                alert("aa");
            }
        </script>
        </div>外层DIV加height......
      

  20.   

    你测试了是不是点不到呢?
    我也想加个层,可是改动太麻烦了。我是用js做头像裁剪的,之前都在ff做,都做好了,然后测试兼容,结果ie不听话。
      

  21.   


    是的我换了同事的机器IE6点不到。。这个绝对定位。。外层要放个容器高度要设置。外层DIV设置高度之后就能点到了你就放个最外层DIV呗
      

  22.   

    框是根据载入图片的大小而设定的,在加个框会动到其他地方,比较麻烦!
    最后无奈只能加了个backgruond:url(0)
    本来想加
    background:#fff;filter:alpha(opacity=0);opacity:0;来透明过去,
    可是这样裁剪的底部高亮部分会被覆盖住
      

  23.   

       <div style="width:100px;height:100px;border:1px solid red;z-index:200; cursor:move;" id="div"> </div>
        <script type="text/javascript">
            document.getElementById("div").onclick=function(){
                alert("aa");
            }
        </script>
    position 定位类型 的问题