OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright 2012 Google Inc. All Rights Reserved. |
| 3 |
| 4 Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 you may not use this file except in compliance with the License. |
| 6 You may obtain a copy of the License at |
| 7 |
| 8 http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
| 10 Unless required by applicable law or agreed to in writing, software |
| 11 distributed under the License is distributed on an "AS IS" BASIS, |
| 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 See the License for the specific language governing permissions and |
| 14 limitations under the License. |
| 15 --> |
| 16 |
| 17 <!DOCTYPE html><meta charset="UTF-8"> |
| 18 <style> |
| 19 .anim { |
| 20 left: 0px; |
| 21 width: 100px; |
| 22 height: 100px; |
| 23 background-color: lightsteelblue; |
| 24 position: absolute; |
| 25 } |
| 26 |
| 27 #a { |
| 28 top: 0px |
| 29 } |
| 30 |
| 31 #b { |
| 32 top: 100px; |
| 33 } |
| 34 |
| 35 #c { |
| 36 top: 200px; |
| 37 } |
| 38 |
| 39 #d { |
| 40 top: 300px; |
| 41 } |
| 42 |
| 43 #expectation { |
| 44 position: absolute; |
| 45 top: 0px; |
| 46 left: 200px; |
| 47 width: 100px; |
| 48 height: 400px; |
| 49 background: red; |
| 50 } |
| 51 </style> |
| 52 |
| 53 <div id="expectation"></div> |
| 54 |
| 55 <div> |
| 56 <div id="a" class="anim a"></div> |
| 57 <div id="b" class="anim b"></div> |
| 58 </div> |
| 59 |
| 60 <div id="fromTemplate"> |
| 61 <div id="c" class="anim a"></div> |
| 62 <div id="d" class="anim b"></div> |
| 63 </div> |
| 64 |
| 65 <div style="height:450px"></div> |
| 66 |
| 67 <script src="../bootstrap.js"></script> |
| 68 <script> |
| 69 "use strict"; |
| 70 |
| 71 var effect = [{left: "100px"}, {left: "200px"}]; |
| 72 |
| 73 var a1 = new Animation( |
| 74 document.querySelector("#a"), effect, {duration: 1.0, fill: "forwards"}); |
| 75 var a2 = new Animation( |
| 76 document.querySelector("#b"), effect, {duration: 2.0, fill: "forwards"}); |
| 77 var a3 = new Animation( |
| 78 document.querySelector("#c"), effect, {duration: 1.0, fill: "forwards"}); |
| 79 var a4 = new Animation( |
| 80 document.querySelector("#d"), effect, {duration: 2.0, fill: "forwards"}); |
| 81 var pgroup1 = new ParGroup([a1, a2], {name: "p1", fill: "forwards"}); |
| 82 var pgroup2 = new ParGroup([a4, a3], {name: "p2", fill: "forwards"}); |
| 83 document.timeline.play( |
| 84 new SeqGroup([pgroup1, pgroup2], {name: "s", fill: "forwards"})); |
| 85 |
| 86 </script> |
OLD | NEW |