1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <?xml version="1.0" encoding="ISO-8859-1"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<script><![CDATA[
function zoom(evt,node)
{
cible = node.getAttributeNS(null , "id");
var svgdoc = evt.target.ownerDocument;
var obj = svgdoc.getElementById(cible);
var transformValue = obj.getAttributeNS(null,"transform");
var matrixValues = transformValue.split(",");
obj.setAttributeNS(null , "transform" , "matrix(1.25 0 0 1.25 "+matrixValues[4]+" "+matrixValues[5]);
}
function normal(evt,node)
{
cible = node.getAttributeNS(null , "id");
var svgdoc = evt.target.ownerDocument;
var obj = svgdoc.getElementById(cible);
var transformValue = obj.getAttributeNS(null,"transform");
var matrixValues = transformValue.split(",");
obj.setAttributeNS(null , "transform" , "matrix(1 0 0 1 "+matrixValues[4]+" "+matrixValues[5]);
}
]]></script>
<defs><linearGradient id="MonDegrade"><stop offset="5%" stop-color="blue"/><stop offset="95%" stop-color="red"/></linearGradient></defs>
<rect x="0" y="0" width="800" height="640" stroke="grey" fill="lightgrey"/>
<polyline points="0,200 , 290,145 , 450,145 , 800,200" fill="none" stroke="url(#MonDegrade)" stroke-linecap="round" stroke-width="8px"/>
<polyline points="0,200 , 290,295 , 450,295 , 800,200" fill="none" stroke="url(#MonDegrade)" stroke-linecap="round" stroke-width="8px"/>
<polyline points="0,200 , 290,495 , 450,495 , 800,200" fill="none" stroke="url(#MonDegrade)" stroke-linecap="round" stroke-width="8px"/>
<g id="rectangle0" transform="matrix(1 0 0 1 300 50)">
<rect x="0" y="0" width="140" height="190" stroke-width="1" stroke="black" fill="red" onmouseover="zoom(evt,evt.target.parentNode)" onmouseout="normal(evt,evt.target.parentNode)"/>
<text x="0" y="190" font-family="Arial" fill="black">rectangle0</text>
</g>
<g id="rectangle1" transform="matrix(1 0 0 1 300 200)" >
<rect x="0" y="0" width="140" height="190" stroke-width="1" stroke="black" fill="red" onmouseover="zoom(evt,evt.target.parentNode)" onmouseout="normal(evt,evt.target.parentNode)"/>
<text x="0" y="190" font-family="Arial" fill="black">rectangle1</text>
</g>
<g id="rectangle2" transform="matrix(1 0 0 1 300 400)">
<rect x="0" y="0" width="140" height="190" stroke-width="1" stroke="black" fill="red" onmouseover="zoom(evt,evt.target.parentNode)" onmouseout="normal(evt,evt.target.parentNode)"/>
<text x="0" y="190" font-family="Arial" fill="black">rectangle2</text>
</g>
</svg> |
Partager