File: computed-transform-value.html

package info (click to toggle)
qtwebkit 2.3.4.dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 290,116 kB
  • ctags: 272,544
  • sloc: cpp: 1,417,496; python: 85,048; ansic: 39,353; perl: 38,858; ruby: 10,313; objc: 9,505; xml: 8,679; asm: 3,864; yacc: 2,458; sh: 1,237; lex: 813; makefile: 592; java: 228; php: 79
file content (49 lines) | stat: -rw-r--r-- 1,655 bytes parent folder | download | duplicates (5)
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
<!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>Get Computed Transform</title>
    <style type="text/css" media="screen">
    .box {
        height: 200px;
        width: 200px;
        background-color: #00a0a0;
    }
    </style>
    <script type="text/javascript" charset="utf-8">
        function printTransform(event)
        {
            var box = event.target;
            var computedTransform = window.getComputedStyle(box).webkitTransform;
            document.getElementById("output").innerHTML = 'Computed transform is ' + computedTransform;
        }
        
    </script>
</head>
<body onclick="printTransform(event)">

<h1>Testing transform computed style</h1>
<p>All boxes are 200x200 pixels. When you click on an element, the computed transform style will be displayed below</p>
<p id="output">Computed style for -webkit-transform displayed here</p>


<div class="box" style="position: absolute; left: 100px; top: 200px; -webkit-transform: scale(1.5, 0.75)">
  scale(1.5, 0.75)
</div>

<div class="box" style="position: absolute; left: 400px; top: 200px; -webkit-transform: rotate(30deg)">
  rotate(30deg)
</div>

<div class="box" style="position: absolute; left: 100px; top: 400px; -webkit-transform: translate(50px, 80px)">
  translate(50px, 80px)
</div>

<div class="box" style="position: absolute; left: 400px; top: 400px; -webkit-transform: translate(10px, 50px) scale(0.8) rotate(-10deg)">
  translate(10px, 50px) scale(0.8) rotate(-10deg)
</div>

</body>
</html>