| 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: 25px; | |
| 23 background-color: #FAA; | |
| 24 position: relative; | |
| 25 } | |
| 26 </style> | |
| 27 | |
| 28 <div id="a" class="anim"></div> | |
| 29 <div id="b" class="anim"></div> | |
| 30 | |
| 31 <script src="../bootstrap.js"></script> | |
| 32 <script> | |
| 33 "use strict"; | |
| 34 | |
| 35 var effect = [{left: "100px"}, {left: "500px"}]; | |
| 36 | |
| 37 var anim1 = new Animation( | |
| 38 document.getElementById("a"), effect, | |
| 39 {duration: 1.0 * 1000, iterations: 3.0, direction: "alternate", fill: 'forwa
rds'}); | |
| 40 | |
| 41 var anim2 = new Animation( | |
| 42 document.getElementById("b"), effect, | |
| 43 {duration: 1.0 * 1000, fill: 'forwards'}); | |
| 44 var animationGroup = new AnimationGroup( | |
| 45 [anim2], | |
| 46 {duration: 1.0 * 1000, iterations: 3.0, direction: "alternate", fill: 'forwa
rds'}); | |
| 47 | |
| 48 document.timeline.play(anim1); | |
| 49 document.timeline.play(animationGroup); | |
| 50 </script> | |
| OLD | NEW |