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