Simple 2D drawing box

Source: Internet
Author: User

<! Doctype HTML> <HTML lang = "en">

. M-tiger. item {transform-style: preserve-3d; perspective: pixel; position: relative; overflow: hidden; display: inline-block; width: 32%; Height: 100%; outline: 1px solid rgba (0.3, 0 );}

. M-tiger. Item +. Item {margin-left: 10px ;}

. M-tiger. textw {position: absolute; left: 0; top: 0; transition-timing-function: cubic-bezr (0 ,. 22, 1 ,. 69); transition-property: Top; width: 100%; Height: 2000px; transform: translate3d (, 0 );}

. M-tiger. textw> span {display: inline-block; width: 100%; Height: 200px; font-size: 160px; line-Height: 1.2; text-align: center; color: #000000 ;}

. M-tiger. f-BTN {position: absolute; Right: 10px; bottom: 10px; width: 80px; Height: 30px; Background-color: dodgerblue; font-size: 18px; line-height: 30px; text-align: center ;}

. M-tiger. F-BTN> A {text-Decoration: none; color: # ffffff ;}

. Bothcenter {transform: translate3d (-50%,-50%, 0);-moz-transform: translate3d (-50%,-50%, 0);-WebKit-transform: translate3d (-50%,-50%, 0);-MS-transform: translate3d (-50%,-50%, 0);-o-transform: translate3d (-50%,-50%, 0 );}

</Style>

<Div class = "M-tiger bothcenter">

<Div class = "item"> <Div class = "textw"> <span> 1 </span> <span> 2 </span> <span> 3 </span> <span> 4 </span> <span> 5 </span> <span> 6 </span> <span> 7 </span> <span> 8 </span> <span> 9 </span> <span> 10 </span> </div>

<Div class = "item"> <Div class = "textw"> <span> 1 </span> <span> 2 </span> <span> 3 </span> <span> 4 </span> <span> 5 </span> <span> 6 </span> <span> 7 </span> <span> 8 </span> <span> 9 </span> <span> 10 </span> </div>

<Div class = "item"> <Div class = "textw"> <span> 1 </span> <span> 2 </span> <span> 3 </span> <span> 4 </span> <span> 5 </span> <span> 6 </span> <span> 7 </span> <span> 8 </span> <span> 9 </span> <span> 10 </span> </div>

<Div class = "F-BTN"> <a href = "#"> click to draw a lottery </a> </div>

</Div>

</Body>

<SCRIPT>

Function Tiger () {var tiger = Document. getelementsbyclassname ("M-tiger") [0]; If (! Tiger) return false; var items = tiger. getelementsbyclassname ("item"); var textws = tiger. getelementsbyclassname ("textw"); var BTN = tiger. getelementsbyclassname ("F-BTN") [0]; var textitms1 = textws [0]. getelementsbytagname ("span"); var evrh = textitms1 [0]. clientheight;

VaR abst = []; var DATA = [];

For (var itm = 0; ITM <items. length; ITM ++) {data. Push (items [ITM]);}

// BTN. addeventlistener ("click", frontmove, false); BTN. addeventlistener ("click", move, false );

/* Function frontmove () {for (var j = 0; j <textws. length; j ++) {textws [J]. style. transitionduration = ". 2 S "; textws [J]. style. top =-(math. random () * 100) + "PX ";}}*/

Function move () {setTimeout (function () {var randoms = [];

For (VAR I = 0; I <textws. length; I ++) {randoms [I] = math. random (). tofixed (1) * textitms1.length; If (randoms [I] = textitms1.length) {randoms [I] = 0;} abst [I] = randoms [I] * evrh; textws [I]. style. transitionduration = ". 6 s "; textws [I]. style. top =-(abst [I]) + "PX" ;}}, 0 );}}

Tiger (); </SCRIPT>

Simple 2D drawing box

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.