ZVON > References > Zvon Example Repository
Example repository: index | categories | search

All > SVG > Script > script-eventDom-BE-01


File: script-eventDom-BE-01
Author: Vincent Hardy
Origin: W3C SVG conformance suite

Rendered imageSVG source
Rendered imageSVG source
Rendered imageSVG source
ElementsAttributes
axlink:href |
descid |
gid | onclick | style |
linestyle | x1 | x2 | y1 | y2 |
pathd | style |
rectheight | id | style | width | x | y |
scripttype |
svgheight | id | width |
textstyle | x | y |
titleid |

Source

<svg id="svg-root" width="450" height="450" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" >
     <title id="test-title">script-eventDom-BE-01</title>
     <desc id="test-desc"> This test validates scripting support by using a simple mouse event handler and manipulating the DOM with the ECMA binding DOM API. </desc>
     <g id="test-body-content">
          <text x="140" y="20" style="fill:black;"> Event and DOM Access Test </text>
          <g id="targetGroup">
               <g id="target" onclick="onMouseClick( evt )">
                    <text x="70" y="190">Click on target</text>
                    <rect x="60" y="200" width="20" height="20" style="fill:white;stroke:none;"/>
                    <line x1="60" y1="210" x2="80" y2="210" style="stroke-width:.5;stroke:black;"/>
                    <line x1="70" y1="200" x2="70" y2="220" style="stroke-width:.5;stroke:black;"/>
               </g>
               <g id="testPassed" style="visibility:hidden;">
                    <text x="70" y="210" style="fill:green;font-size:30;font-weight:bold;">Scripting Test Passed!</text>
               </g>
          </g>
          <script type="text/ecmascript">
		
    function onMouseClick(evt) {

		// Get Document
    var target = evt.getTarget();
		var doc = target.getOwnerDocument();

		// Make test result visible
		var testPassed = doc.getElementById('testPassed');
		testPassed.setAttribute('style', 'visibility:visible');
		
		// Make target invisible
		var target = doc.getElementById('target');
		target.setAttribute('style', 'visibility:hidden');
    }
		
	
</script>
     </g>
     <g id="test-legend" style="fill:black;font-family:Helvetica;font-size:10;">
          <rect x="10" y="390" width="275" height="50" style="fill:none;stroke:#000000;"/>
          <path style="fill:none;stroke:#000000;" d="M10 405 h275 M205 405 v35 M10 426 h195 M205 422 h80"/>
          <text x="25" y="401">Scalable Vector Graphics (SVG) Conformance Suite</text>
          <a xlink:href="copyright-documents-19990405.html">
               <text x="12" y="437" style="fill:blue;"> Copyright 2000 W3C. All Rights Reserved. </text>
          </a>
          <text style="font-size:12;" x="35" y="420">script-eventDom-BE-01</text>
          <text style="font-size:10;" x="210" y="417">$Revision: 1.1 $</text>
          <text style="font-size:10;" x="210" y="435">Release 2.0</text>
          <rect id="test-frame" x="1" y="1" width="448" height="448" style="fill:none;stroke:#000000;"/>
     </g>
</svg>



Sponsored links: Domain Names, VoIP Internettelefonie, DSL, SDSL, ADSL, UNLIMITED Web Hosting by HostDepartment, conference call service, answering service