blob: 9adabdfc9084de2ab086850b33bb7f0077d934ec [file]
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
<!--
Copyright 2002-2003 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- ====================================================================== -->
<!-- Modification of the visibility property -->
<!-- -->
<!-- @author tkormann@ilog.fr -->
<!-- @version $Id$ -->
<!-- ====================================================================== -->
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
<svg id="body" width="450" height="500" viewBox="0 0 450 500">
<title>'visibility' property on 'onclick</title>
<text x="50%" y="45" class="title">'visibility' property on 'onclick'</text>
<script type="text/ecmascript"><![CDATA[
function changeVisibility(elem, newValue) {
elem.style.setProperty("visibility", newValue, "");
}
function doChange() {
changeVisibility(document.getElementById("gHide"), "hidden");
changeVisibility(document.getElementById("r1Hide"), "hidden");
changeVisibility(document.getElementById("r2Hide"), "hidden");
changeVisibility(document.getElementById("r3Hide"), "hidden");
changeVisibility(document.getElementById("r4Hide"), "hidden");
changeVisibility(document.getElementById("i1Hide"), "hidden");
changeVisibility(document.getElementById("gShow"), "visible");
changeVisibility(document.getElementById("r1Show"), "visible");
changeVisibility(document.getElementById("r2Show"), "visible");
changeVisibility(document.getElementById("r3Show"), "visible");
changeVisibility(document.getElementById("r4Show"), "visible");
changeVisibility(document.getElementById("i1Show"), "visible");
}
// This function is only called if test is run from regard.
function regardStart() {
doChange();
setTimeout('regardTestInstance.scriptDone()', 200);
}
]]></script>
<linearGradient id="grad">
<stop style="stop-color:crimson" offset="0" />
<stop style="stop-color:gold" offset="1" />
</linearGradient>
<g id="test-content" stroke="black" stroke-width="1">
<g stroke="black" onclick="doChange()" >
<circle cx="100" cy="100" r="10" fill="crimson"/>
<line x1="85" x2="115" y1="100" y2="100" fill="none" />
<line x1="100" x2="100" y1="85" y2="115" fill="none" />
</g>
<text class="legend" style="text-anchor:start" stroke="none">
<tspan x="150" y="97">Click on the Click Target (crimson circle)</tspan>
<tspan x="150" y="113">to toggle visibility on elements.</tspan>
</text>
<g id="gHide" style="visibility:visible">
<rect x="100" y="150" width="100" height="50" style="fill:#eee"/>
<rect x="150" y="150" width="100" height="50" style="fill:gold"/>
<rect x="200" y="150" width="100" height="50" style="fill:crimson"/>
<rect x="250" y="150" width="100" height="50" style="fill:url(#grad)"/>
<image x="350" y="150" width="50" height="50"
xlink:href="../../resources/images/png2.png"/>
</g>
<g>
<g style="fill:#eee">
<rect id="r1Hide" x="100" y="225" width="100" height="50"
style="visibility:visible"/></g>
<g style="fill:gold">
<rect id="r2Hide" x="150" y="225" width="100" height="50"
style="visibility:visible"/></g>
<g style="fill:crimson">
<rect id="r3Hide" x="200" y="225" width="100" height="50"
style="visibility:visible"/></g>
<g style="fill:url(#grad)">
<rect id="r4Hide" x="250" y="225" width="100" height="50"
style="visibility:visible"/></g>
<image id="i1Hide" x="350" y="225" width="50" height="50"
xlink:href="../../resources/images/png2.png"/>
</g>
<g id="gShow" style="visibility:hidden">
<rect x="100" y="300" width="100" height="50" style="fill:#eee"/>
<rect x="150" y="300" width="100" height="50" style="fill:gold"/>
<rect x="200" y="300" width="100" height="50" style="fill:crimson"/>
<rect x="250" y="300" width="100" height="50" style="fill:url(#grad)"/>
<image x="350" y="300" width="50" height="50"
xlink:href="../../resources/images/png2.png"/>
</g>
<g>
<g style="fill:#eee">
<rect id="r1Show" x="100" y="375" width="100" height="50"
style="visibility:hidden"/></g>
<g style="fill:gold">
<rect id="r2Show" x="150" y="375" width="100" height="50"
style="visibility:hidden"/></g>
<g style="fill:crimson">
<rect id="r3Show" x="200" y="375" width="100" height="50"
style="visibility:hidden"/></g>
<g style="fill:url(#grad)">
<rect id="r4Show" x="250" y="375" width="100" height="50"
style="visibility:hidden"/></g>
<g><image id="i1Show" x="350" y="375" width="50" height="50"
style="visibility:hidden"
xlink:href="../../resources/images/png2.png"/></g>
</g>
</g>
</svg>