A drag-and-drop technique for sharing HTML5

Source: Internet
Author: User

This is the effect: before dragging

  

After:

On the code:

<! DOCTYPE html>true] {                -moz-user-Select:none; -khtml-user-drag:element;            Cursor:move; }            *:-khtml-Drag {background-color:rgba (238,238,238, 0.5); } A {text-Decoration:none; Color: #000;                width:120px; border:3px Dashed #999;                padding:10px; Display:inline-Block;                Transition:all 1s;                Position:absolute;            top:10px;            }. container {position:relative; } a.move {-webkit-transform:scale3d (1.1, 1.1, 1.1 ); } a:hover:after {content:' (Drag Me) '; Color:green}</style> varOrigin, is_moving =false; $(". Container"). Find ("a"). On ("Drop"),            function(e) {varOrigin_pos = $ (origin). Position ();varTarget_pos =$ (e.target). Position (); $ (Origin). addclass ("Move"). Animate (Target_pos, "fast",                    function() {Console.log ( This); $( This). Removeclass ("Move");                }); $ (e.target). addclass ("Move"). Animate (Origin_pos, "fast",                function() {                    $( This). Removeclass ("Move");            }); }). On ("DragStart",            function(e) {if(is_moving) {return false; } is_moving=true; e.originalevent.datatransfer.effectallowed = ' Move '; Origin= This; }). On ("DragOver",            function(e) {if(E.preventdefault) E.preventdefault ();//Is_moving =false; E.originalevent.datatransfer.dropeffect= ' move ';//            }); </script> </body>

Daily sentence: I always knew looking back on the tears would make me laugh, but I never knew looking back on the laughs would make M E cry.

I know that when I look back, those tears want to laugh, but I do not know how to look back, those laughter can also call me to tears.

A drag-and-drop technique for sharing HTML5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.