A div based on Tweenmax followed by a mouse click to move

Source: Internet
Author: User

Today we share a div that is based on Tweenmax followed by mouse click to move. In this instance you can click anywhere and the div will move to the location you clicked. As follows:

Online preview Source Download

The implemented code.

HTML code:

 

CSS code:

        HTML {cursor:pointer;            } body {font-family: ' Lato ', Sans-serif;            Font-size:1em;            margin:0; Background:radial-gradient (black 15%, transparent 16%) 0 0, Radial-gradient (black 15%, transparent 16%) 8px 8px, Radial-gradient (Rgba (255,255,255,.1) 15%, transparent 20%) 0 1px, Radial-gradient (Rgba (255,255,255,.1) 15%, transparent 20%)            8PX 9px;            Background-color: #282828;            BACKGROUND-SIZE:16PX 16px;        Overflow:hidden;            }. block {width:250px;            Color: #F7F6F2;            Text-align:center;            Padding-top:1.5em;            height:100px;            Position:absolute;            Background: #000;            opacity:0.7;            border-radius:2px;            Border:none;            -moz-box-sizing:border-box;            -webkit-box-sizing:border-box;         Box-sizing:border-box;   box-shadow:4px 4px 4px 4px rgba (0,0,0,0.4);            -moz-shadow:4px 4px 4px 4px rgba (0,0,0,0.4);            -webkit-shadow:4px 4px 4px 4px rgba (0,0,0,0.4);            Box-shadow: -4px 4px-4px 4px Rgba (0,0,0,0.4);            -moz-shadow: -4px 4px-4px 4px Rgba (0,0,0,0.4);        -webkit-shadow: -4px 4px-4px 4px Rgba (0,0,0,0.4);            } #cue {Background:rgba (255, 255, 10, 0.5);            width:100px;            height:100px;            Position:absolute;            border-radius:100px;            -webkit-transition:-webkit-transform 1s;            -moz-transition:-moz-transform 1s;            -ms-transition:-ms-transform 1s;            -o-transition:-o-transform 1s;            Transition:transform 1s;            -webkit-transform:scale (0,0);            -moz-transform:scale (0,0);            -ms-transform:scale (0,0);            -o-transform:scale (0,0);        Transform:scale (0,0);  }. Down #cue {          -webkit-transform:scale (1, 1);            -moz-transform:scale (1, 1);            -ms-transform:scale (1, 1);            -o-transform:scale (1, 1);        Transform:scale (1, 1); }

A div based on Tweenmax followed by a mouse click to move

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.