XML technologies / SVG / Interactive graphics / Manipulating graphic elements / Manipulating the visible property / Calling the scripts
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
The scripts are essentially complete, but still need to be called. Specify which scripts should run when the texts are clicked, using the onclick attribute. In the horizontal navigation bar, put this attribute in the <a> tag defining the hyperlink; in the vertical navigation bar, put it in the <text> tag.
Both work the same way. However, defining a hyperlink changes the pointer appropriately over the element, whereas ordinary text only displays a text cursor. In practice, it is therefore better always to use the <a> tag. The following example demonstrates both possibilities.
<g id="vertikal" style="font-family:'Arial Black',Helvetica;font-size:12px;fill:rgb(0,0,0)">
<text x="0" y="230" transform="rotate(-20) translate(-70,0)" onclick="anzeigen(evt,'K01',140,180)">Was ist SVG?</text>
<text x="0" y="260" transform="rotate(-20) translate(-80,0)" onclick="anzeigen(evt,'K02',140,220)">SVG FAQ</text>
<text x="0" y="290" transform="rotate(-20) translate(-90,0)" onclick="anzeigen(evt,'K03',140,250)">Links</text>
<text x="0" y="320" transform="rotate(-20) translate(-100,0)" onclick="anzeigen(evt,'K04',140,285)">Beispiele</text>
<text x="0" y="350" transform="rotate(-20) translate(-110,0)" onclick="anzeigen(evt,'K05',140,140)">Editoren</text>
<text x="0" y="380" transform="rotate(-20) translate(-122,0)" onclick="anzeigen(evt,'K06',140,360)">Viewer und Tools</text>
</g>
<g id="horizontal" style="font-family:'Arial Black',Helvetica;font-size:12px;fill:rgb(0,0,0)">
<text x="290" y="115"><a class="schwarz" onclick="aufklh(evt,'Kontakt')">Kontakt |</a></text>
<text x="361" y="115"><a class="schwarz" onclick="aufklh(evt,'Impressum')"> Impressum |</a></text>
<text x="452" y="115"><a class="schwarz" onclick="aufklh(evt,'Ziel')"> Ziel der Seite |</a></text>
<text x="554" y="115"><a class="schwarz" onclick="aufklh(evt,'Projekte')"> Weitere Projekte</a></text>
<use x="2320" y="330" xlink:href="#smButton" transform="scale(0.3)" style="opacity:0.7" onclick="aufklh(evt,'')"/>
</g>
Copyright © verlag moderne industrie GmbH 2001
You may print the online version for your private use.
Otherwise, this chapter from “Das Einsteigerseminar SVG — Webgrafiken mit XML” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
verlag moderne industrie GmbH, Justus-von-Liebig-Straße 1, D-86899 Landsberg/Lech, fon ++49 (0) 81 91 / 125 – 0, leserservice(at)mi-verlag.de
back to top