| 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 the visibility property --> |
| 25 |
<!-- --> |
| 26 |
<!-- @author [email protected] --> |
| 27 |
<!-- @version $Id$ --> |
| 28 |
<!-- ====================================================================== --> |
| 29 |
|
| 30 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 31 |
|
| 32 |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500"> |
| 33 |
<title>'visibility' property on 'onclick</title> |
| 34 |
|
| 35 |
<text x="50%" y="45" class="title">'visibility' property on 'onclick'</text> |
| 36 |
|
| 37 |
<script type="text/ecmascript"><![CDATA[ |
| 38 |
function changeVisibility(elem, newValue) { |
| 39 |
elem.style.setProperty("visibility", newValue, ""); |
| 40 |
} |
| 41 |
function doChange() { |
| 42 |
changeVisibility(document.getElementById("gHide"), "hidden"); |
| 43 |
changeVisibility(document.getElementById("r1Hide"), "hidden"); |
| 44 |
changeVisibility(document.getElementById("r2Hide"), "hidden"); |
| 45 |
changeVisibility(document.getElementById("r3Hide"), "hidden"); |
| 46 |
changeVisibility(document.getElementById("r4Hide"), "hidden"); |
| 47 |
changeVisibility(document.getElementById("i1Hide"), "hidden"); |
| 48 |
|
| 49 |
changeVisibility(document.getElementById("gShow"), "visible"); |
| 50 |
changeVisibility(document.getElementById("r1Show"), "visible"); |
| 51 |
changeVisibility(document.getElementById("r2Show"), "visible"); |
| 52 |
changeVisibility(document.getElementById("r3Show"), "visible"); |
| 53 |
changeVisibility(document.getElementById("r4Show"), "visible"); |
| 54 |
changeVisibility(document.getElementById("i1Show"), "visible"); |
| 55 |
} |
| 56 |
|
| 57 |
// This function is only called if test is run from regard. |
| 58 |
function regardStart() { |
| 59 |
doChange(); |
| 60 |
setTimeout('regardTestInstance.scriptDone()', 200); |
| 61 |
} |
| 62 |
]]></script> |
| 63 |
|
| 64 |
<linearGradient id="grad"> |
| 65 |
<stop style="stop-color:crimson" offset="0" /> |
| 66 |
<stop style="stop-color:gold" offset="1" /> |
| 67 |
</linearGradient> |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
<g id="test-content" stroke="black" stroke-width="1"> |
| 72 |
<g stroke="black" onclick="doChange()" > |
| 73 |
<circle cx="100" cy="100" r="10" fill="crimson"/> |
| 74 |
<line x1="85" x2="115" y1="100" y2="100" fill="none" /> |
| 75 |
<line x1="100" x2="100" y1="85" y2="115" fill="none" /> |
| 76 |
</g> |
| 77 |
<text class="legend" style="text-anchor:start" stroke="none"> |
| 78 |
<tspan x="150" y="97">Click on the Click Target (crimson circle)</tspan> |
| 79 |
<tspan x="150" y="113">to toggle visibility on elements.</tspan> |
| 80 |
</text> |
| 81 |
|
| 82 |
<g id="gHide" style="visibility:visible"> |
| 83 |
<rect x="100" y="150" width="100" height="50" style="fill:#eee"/> |
| 84 |
<rect x="150" y="150" width="100" height="50" style="fill:gold"/> |
| 85 |
<rect x="200" y="150" width="100" height="50" style="fill:crimson"/> |
| 86 |
<rect x="250" y="150" width="100" height="50" style="fill:url(#grad)"/> |
| 87 |
<image x="350" y="150" width="50" height="50" |
| 88 |
xlink:href="../../resources/images/png2.png"/> |
| 89 |
</g> |
| 90 |
|
| 91 |
<g> |
| 92 |
<g style="fill:#eee"> |
| 93 |
<rect id="r1Hide" x="100" y="225" width="100" height="50" |
| 94 |
style="visibility:visible"/></g> |
| 95 |
<g style="fill:gold"> |
| 96 |
<rect id="r2Hide" x="150" y="225" width="100" height="50" |
| 97 |
style="visibility:visible"/></g> |
| 98 |
<g style="fill:crimson"> |
| 99 |
<rect id="r3Hide" x="200" y="225" width="100" height="50" |
| 100 |
style="visibility:visible"/></g> |
| 101 |
<g style="fill:url(#grad)"> |
| 102 |
<rect id="r4Hide" x="250" y="225" width="100" height="50" |
| 103 |
style="visibility:visible"/></g> |
| 104 |
<image id="i1Hide" x="350" y="225" width="50" height="50" |
| 105 |
xlink:href="../../resources/images/png2.png"/> |
| 106 |
</g> |
| 107 |
|
| 108 |
<g id="gShow" style="visibility:hidden"> |
| 109 |
<rect x="100" y="300" width="100" height="50" style="fill:#eee"/> |
| 110 |
<rect x="150" y="300" width="100" height="50" style="fill:gold"/> |
| 111 |
<rect x="200" y="300" width="100" height="50" style="fill:crimson"/> |
| 112 |
<rect x="250" y="300" width="100" height="50" style="fill:url(#grad)"/> |
| 113 |
<image x="350" y="300" width="50" height="50" |
| 114 |
xlink:href="../../resources/images/png2.png"/> |
| 115 |
</g> |
| 116 |
|
| 117 |
<g> |
| 118 |
<g style="fill:#eee"> |
| 119 |
<rect id="r1Show" x="100" y="375" width="100" height="50" |
| 120 |
style="visibility:hidden"/></g> |
| 121 |
<g style="fill:gold"> |
| 122 |
<rect id="r2Show" x="150" y="375" width="100" height="50" |
| 123 |
style="visibility:hidden"/></g> |
| 124 |
<g style="fill:crimson"> |
| 125 |
<rect id="r3Show" x="200" y="375" width="100" height="50" |
| 126 |
style="visibility:hidden"/></g> |
| 127 |
<g style="fill:url(#grad)"> |
| 128 |
<rect id="r4Show" x="250" y="375" width="100" height="50" |
| 129 |
style="visibility:hidden"/></g> |
| 130 |
<g><image id="i1Show" x="350" y="375" width="50" height="50" |
| 131 |
style="visibility:hidden" |
| 132 |
xlink:href="../../resources/images/png2.png"/></g> |
| 133 |
</g> |
| 134 |
</g> |
| 135 |
</svg> |