ドキュメント https://greensock.com/docs boxを動かす 複数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>HTML 5 complete</title> <!--[if IE]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <style> article, aside, dialog, figure, footer, header, hgroup, menu, nav, section { display: block; } </style> <style> #container { max-width: 980px; } #container > div { height: 150px; width: 150px; text-align: center; vertical-align: center; margin: 20px; float: left; color : white; font-size: 17px; line-height: 100px; } .box1 { background-color: blue; } .box2 { background-color: RoyalBlue; } .box3 { background-color: DarkBlue; } .box4 { background-color: blue; } .box5 { background-color: RoyalBlue; } .box6 { background-color: orange; } .box7 { background-color: mediumvioletred; } .box8 { background-color: palevioletred; } .box9 { background-color: aqua; } .box10 { background-color: gray; } </style> <div id="container"> <div class="box1">1</div> <div class="box2">2</div> <div class="box3">3</div> <div class="box4">4</div> <div class="box5">5</div> <div class="box6">6 ( ゚ー゚)触って</div> <div class="box7">7</div> <div class="box8">8</div> <div class="box9">9</div> <div class="box10">10</div> <script src="//cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script> <script> (function(){ 'use strict'; console.log('test'); TweenMax.from('.box1', 1 , { scale: 0.5, delay: 1 }); TweenMax.to('.box2', 3, { y: 300, ease: Power2.easeOut, repeat: 1 }); TweenMax.to('.box3', 1, { x: 200 }); TweenMax.to('.box4', 1, { x: -200, rotationY: 360 }); TweenMax.to('.box5', 2, { y: -300, ease: Power2.easeOut, }); TweenMax.to('.box7', 2, { y: 500, x: 200, ease: Power2.easeOut, }); TweenMax.to('.box8', 2, { y: 550, x: 250, ease: Power2.easeOut, }); const elm = document.querySelector('.box9'); (new TimelineMax()) .to(elm, 1, { x: 250, backgroundColor: 'blue', opacity: 0.8 }) .to(elm, 2, { y: -400, backgroundColor: 'RoyalBlue', opacity: 1 }) .to(elm, 1, { x: 0, backgroundColor: 'DarkBlue', opacity: 0.8 }) .to(elm, 2, { y: 0, backgroundColor: 'green', opacity: 1 }); TweenMax.fromTo('.box10', 2, { width: '100%', x: 300 }, { width: '5%', x: 0 }); })(); </script> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(".box6").hover(function(){ TweenMax.to('.box6', 1, { x: 6000 }); }); </script> </body> </html> |
DEMO @see 爆速レンタルサーバならConoHa WING サーバはプロに全部お任せ!「仕事」に専念したいあなたにおすすめです。 …