summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/transition-left.html
blob: 492e30600ab5855b84fc4aeb5bbc8a8c96ea8ca0 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Transition of left property</title>
    <style>
         div {
             position: relative;
             left: 100px;
             height: 200px;
             width: 300px;
             background-color: #9bb;
             -webkit-transition-property: left;
             -webkit-transition-duration: 1s;
         }
     </style>
     <script type="text/javascript" charset="utf-8">
      
      var flag = true;
      
      function init() {
        document.getElementById("target").addEventListener("click", function(evt) {
          if (flag)
            evt.target.style.left = "300px";
          else 
            evt.target.style.left = "100px";
          flag = !flag;
        }, false);
      }
      
      window.addEventListener("load", init, false);
     </script>
</head>
<body>
  <h1>Transition of 'left' property</h1>

  <p>The element below should move 200 pixels left or right when clicked</p>
  
  <div id="target">
    This element should transition.
  </div>

</body>
</html>