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