<community>of XML and SVG Developers</community>
This is a discussion on how to tell whether zoom in or out? within the SVG Questions forums, part of the SVG Forums category; Hey, I added an eventlistener: svgDoc.rootElement.addEventListener("SVGZoom", sync, false); sync is a function that keeps sizes of some shapes constant as ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| I added an eventlistener: svgDoc.rootElement.addEventListener("SVGZoom", sync, false); sync is a function that keeps sizes of some shapes constant as the background map zooms. In order to do that without hard-coding values in, I need to know whether the used clicked zoom-in or zoom-out. Is there a way to retrieve that information? Thanks in advance! Carlos |
| |||
|
Hi, By default, svg enable us to press "CTRL" + left click to zoom in and each time we zoom in, the scale will b... newScale = currentScale * 2...So what i'm trying to do is set it to b... newScale = currentScale * 1.5 Below is my code, when i try to zoom in, i get a "Stack overflow" error. The way i do it is wrong? Can anyone show me the correct way to do it? Thanks in advance <svg id="root" width="200" height="200" viewBox="0 0 200 200" onload="Initialize(evt)"> <script language="javascript"> <![CDATA[ var currentScale; var newScale; function Initialize(evt) { var SVGDoc = evt.getTarget().getOwnerDocument (); SVGRoot = SVGDoc.getElementById("root"); SVGDoc.rootElement.addEventListener ("SVGZoom", zoomScale, false); } function zoomScale() { currentScale = SVGRoot.currentScale; newScale = currentScale * 1.5; SVGRoot.setCurrentScale(newScale); } ]]></script> <circle cx="20" cy="20" r="15" style="fill: blue"/> <rect x="100" y="100" width="10" height="20" style="fill: green"/> </svg> |
Compatible Inkjet Cartridges
At PRINK we offer Free UK Delivery on the highest quality guaranteed compatible inkjet cartridges. We stock over 50,000 inkjet cartridges.
ink cartridges
Ink cartridges for sale online! Don't miss out on some quality bargains… Great prices for top brand names. See for yourself!
hard disk drive data recovery cheshire
Do you urgently need data recovery from your hard disk drive done in Cheshire? We have an unrivalled success rate.