Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" standalone="no"?>
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
- <svg xmlns="http://www.w3.org/2000/svg" width="6cm" height="5cm" viewBox="0 0 600 500" version="1.1" onload="set_col(evt)">
- <desc>Example script, set color by URI parameter
- </desc>
- <!-- ECMAScript to change the radius with each click -->
- <script type="application/ecmascript"><![CDATA[
- function set_col(evt){
- // debugger
- var params = document.location.search.slice(1).split('&')
- for (i = 0; i < params.length; i++){
- if (params[i].indexOf("color=")==0){
- document.getElementById("cc").setAttribute('fill',params[i].split('=')[1])
- }
- }
- }
- ]]></script>
- <!-- Outline the drawing area with a blue line -->
- <rect x="1" y="1" width="598" height="498" fill="none" stroke="blue"/>
- <!-- Act on each click event -->
- <circle id="cc" cx="300" cy="225" r="200" fill="blue"/>
- </svg>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement