| 1 |
<?xml version="1.0" standalone="no"?> |
| 2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN" |
| 3 |
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd"> |
| 4 |
|
| 5 |
<!-- |
| 6 |
|
| 7 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 8 |
contributor license agreements. See the NOTICE file distributed with |
| 9 |
this work for additional information regarding copyright ownership. |
| 10 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 11 |
(the "License"); you may not use this file except in compliance with |
| 12 |
the License. You may obtain a copy of the License at |
| 13 |
|
| 14 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 15 |
|
| 16 |
Unless required by applicable law or agreed to in writing, software |
| 17 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 18 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 |
See the License for the specific language governing permissions and |
| 20 |
limitations under the License. |
| 21 |
|
| 22 |
--> |
| 23 |
<!-- ====================================================================== --> |
| 24 |
<!-- Modification of a transform attribute --> |
| 25 |
<!-- --> |
| 26 |
<!-- @author [email protected] --> |
| 27 |
<!-- @version $Id$ --> |
| 28 |
<!-- ====================================================================== --> |
| 29 |
|
| 30 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 31 |
|
| 32 |
<svg id="body" width="450" height="500" viewBox="0 0 450 500"> |
| 33 |
<title>transform attribute in 'onload'</title> |
| 34 |
|
| 35 |
<text x="50%" y="45" class="title">transform attributes in 'onload'</text> |
| 36 |
|
| 37 |
<script type="text/ecmascript"> |
| 38 |
|
| 39 |
function transform(evt, transform) { |
| 40 |
var elt = evt.target; |
| 41 |
elt.setAttribute("transform", transform) |
| 42 |
} |
| 43 |
|
| 44 |
</script> |
| 45 |
|
| 46 |
<g id="test-content" > |
| 47 |
|
| 48 |
|
| 49 |
<g> |
| 50 |
|
| 51 |
<rect x="0" y="0" width="100" height="100" style="fill:crimson" |
| 52 |
onload="transform(evt, 'translate(20 100)')"/> |
| 53 |
|
| 54 |
<circle cx="0" cy="0" r="50" style="fill:orange" |
| 55 |
onload="transform(evt, 'translate(220 150)')"/> |
| 56 |
|
| 57 |
<ellipse cx="0" cy="0" rx="50" ry="25" style="fill:gold" |
| 58 |
onload="transform(evt, 'translate(370 150)')"/> |
| 59 |
|
| 60 |
<polygon points="50 0 100 100 0 100" style="fill:crimson" |
| 61 |
onload="transform(evt, 'translate(20 250)')"/> |
| 62 |
|
| 63 |
<polyline points="50 0 100 100 0 100 50 0" style="fill:orange" |
| 64 |
onload="transform(evt, 'translate(170 250)')"/> |
| 65 |
|
| 66 |
<path d="M50 0 L100 100 L0 100Z" style="fill:gold" |
| 67 |
onload="transform(evt, 'translate(320 250)')"/> |
| 68 |
|
| 69 |
<line x1="0" y1="0" x2="100" y2="50" |
| 70 |
style="stroke:crimson; stroke-width:8; fill:none" |
| 71 |
onload="transform(evt, 'translate(20 400)')"/> |
| 72 |
|
| 73 |
<text x="0" y="0" |
| 74 |
style="fill:orange; text-anchor:middle;font-size:48" |
| 75 |
onload="transform(evt, 'translate(220 420)')">Batik</text> |
| 76 |
|
| 77 |
<image x="0" y="0" width="50" height="50" |
| 78 |
xlink:href="../../resources/images/png2.png" |
| 79 |
onload="transform(evt, 'translate(320 400)')" /> |
| 80 |
<image x="0" y="0" width="50" height="50" |
| 81 |
xlink:href="../../resources/images/svg.svg" |
| 82 |
onload="transform(evt, 'translate(370 400)')" /> |
| 83 |
</g> |
| 84 |
|
| 85 |
<g style="fill:none; stroke:black"> |
| 86 |
|
| 87 |
<rect x="0" y="0" width="100" height="100" transform="translate(20 100)"/> |
| 88 |
|
| 89 |
<circle cx="0" cy="0" r="50" transform="translate(220 150)"/> |
| 90 |
|
| 91 |
<ellipse cx="0" cy="0" rx="50" ry="25" transform="translate(370 150)"/> |
| 92 |
|
| 93 |
<polygon points="50 0 100 100 0 100" transform="translate(20 250)"/> |
| 94 |
|
| 95 |
<polyline points="50 0 100 100 0 100 50 0" transform="translate(170 250)"/> |
| 96 |
|
| 97 |
<path d="M50 0 L100 100 L0 100Z" transform="translate(320 250)"/> |
| 98 |
|
| 99 |
<line x1="0" y1="0" x2="100" y2="50" transform="translate(20 400)"/> |
| 100 |
|
| 101 |
<text x="0" y="0" |
| 102 |
style="stroke:black; fill:none; text-anchor:middle;font-size:48" |
| 103 |
transform="translate(220 420)">Batik</text> |
| 104 |
<rect x="0" y="0" width="50" height="50" transform="translate(320 400)" |
| 105 |
style="stroke:black; fill:none;"/> |
| 106 |
<rect x="0" y="0" width="50" height="50" transform="translate(370 400)" |
| 107 |
style="stroke:black; fill:none;"/> |
| 108 |
|
| 109 |
</g> |
| 110 |
|
| 111 |
</g> |
| 112 |
|
| 113 |
</svg> |