Onelong

分享知识,与你一起进步......
RSS icon Home icon
  • firefox下的对象捕捉

    post by onelong / 2009-12-22 23:14 Tuesday [javascript]

    <html>
    <head></head>
    <body>
    <div style="position: absolute; left: 100px; top: 100px; width: 200px; height: 200px; background-color: rgb(255, 221, 238);" onmousedown="beginDrag(this,event);"></div>
    <script type="text/javascript">
        function beginDrag(obj,evt){
            var detlaX = evt.layerX;
            var detlaY = evt.layerY;
            obj.addEventListener("mousemove",move,true);
            obj.addEventListener("mouseup",up,true);
            window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
            function move(evt){
                obj.style.left = evt.clientX - detlaX + "px";
                obj.style.top = evt.clientY - detlaY + "px";
            }
            function up(evt){
                obj.removeEventListener("mousemove",move,true);
                obj.removeEventListener("mouseup",up,true);
                window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
            }
        }
    </script>
    </body>
    </html>

    引用地址:
     

    评论:

    1. backlinks
      what's up www.ways2u.com admin found your blog via yahoo but it was hard to find and I see you could have more visitors because there are not so many comments yet. I have discovered website which offer to dramatically increase traffic to your site http://xrumerservice.org they claim they managed to get close to 1000 visitors/day using their services you could also get lot more targeted traffic from search engines as you have now. I used their services and got significantly more visitors to my site. Hope this helps :) They offer backlink popularity professional seo <a href=http://xrumerservice.org>backlinks</a> 10000 backlinks Take care. John

    我要评论