• λ我爱Aspx >> Asp.Net >> 点鼠标,弹出一个层,并且跟随鼠标,如何作啊?---在线
  • 点鼠标,弹出一个层,并且跟随鼠标,如何作啊?---在线

  • :aspxer  Դ:csdn  :2007-7-6 2:49:31  ؼ:
  • 我希望在一个连接上点击鼠标后,弹出一个层,并且这个层的位置是根据鼠标的位置走的。

    google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_color_url = "000000";

    如何实现阿?

    第2楼. 由 hookee 于 2007-6-27 13:26:36 发表

    <script>

    function flow(){

    x = event.x;

    y = event.y;

    var obj = document.getElementById("pad");

    obj.style.left = x;

    obj.style.top = y;

    }

    function init(){

    var obj = document.getElementById("pad");

    document.body.onmousemove = flow;

    obj.style.visibility = "visible";

    }

    </script>

    <input type="button" onclick="init();">

    <div id="pad" style="position:absolute;left:0px;top:0px;width:100px;height:100px;background-color:red;visibility:hidden;"></div>

    第3楼. 由 palocc 于 2007-6-27 14:27:12 发表

    可能我没说清楚,我是说鼠标点击后根据鼠标的位置显示这个层,不过这个层不用跟随鼠标移动。只要显示在相应位置就行。

    第4楼. 由 palocc 于 2007-6-27 14:29:04 发表

    好了,我根据你的代码修改了一下~

    多谢~

    Ҷƪл˵?
  • һƪ页面显示Excel文档的问题
    һƪCSS样式的一点小疑惑