| 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 ellipse' attributes --> |
| 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><ellipse> attributes 'onload'</title> |
| 34 |
|
| 35 |
<text x="50%" y="45" class="title"><ellipse> attributes in 'onload'</text> |
| 36 |
|
| 37 |
<script type="text/ecmascript"> |
| 38 |
|
| 39 |
function initEllipse(evt, cx, cy, rx, ry) { |
| 40 |
var elt = evt.target; |
| 41 |
elt.setAttribute("rx", rx) |
| 42 |
elt.setAttribute("ry", ry) |
| 43 |
elt.setAttribute("cx", cx) |
| 44 |
elt.setAttribute("cy", cy) |
| 45 |
} |
| 46 |
|
| 47 |
</script> |
| 48 |
|
| 49 |
<g id="test-content"> |
| 50 |
|
| 51 |
<ellipse rx="1" ry="1" style="fill:orange" |
| 52 |
onload="initEllipse(evt, 120, 155, 80, 50)" /> |
| 53 |
|
| 54 |
<ellipse rx="1" ry="1" style="fill:crimson" |
| 55 |
onload="initEllipse(evt, 320, 155, 20, 50)" /> |
| 56 |
|
| 57 |
<ellipse rx="1" ry="1" style="fill:gold" |
| 58 |
onload="initEllipse(evt, '50%', 355, '20px', '10%')" /> |
| 59 |
|
| 60 |
<g style="stroke:black; fill:none; stroke-width:2"> |
| 61 |
<ellipse cx="120" cy="155" rx="80" ry="50" /> |
| 62 |
<ellipse cx="320" cy="155" rx="20" ry="50" /> |
| 63 |
<ellipse cx="50%" cy="355" rx="20px" ry="10%" /> |
| 64 |
</g> |
| 65 |
|
| 66 |
<g style="fill:black; stroke:none; text-anchor:middle"> |
| 67 |
<text x="125" y="230" >rx, ry, cx, cy</text> |
| 68 |
<text x="325" y="230" >rx, ry, cx, cy</text> |
| 69 |
<text x="50%" y="430" >rx, ry, cx, cy (units and %)</text> |
| 70 |
</g> |
| 71 |
</g> |
| 72 |
</svg> |