O'Reilly logo

Designing SVG Web Graphics by Andrew H. Watt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Zooming, Panning and Scrolling SVG Images

Conforming SVG viewers are required to provide the zooming and panning of SVG images. The details of how that is done are left to the implementation in individual SVG viewers.

However, in some situations, you may not want a user to be able to use zooming and panning. In this type of situation, you can disable zooming by setting the zoomAndPan attribute on the outer <svg> element to a value of disable:

<svg zoomAndPan="disable"> 

The only other value that the zoomAndPan attribute might take is magnify, which is the default. If the zoomAndPan attribute is not mentioned in an <svg> element, therefore, zooming and panning are enabled.

Adding a zoomAndPan attribute to a nested <svg> element has no effect ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required