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 ...

Get Designing SVG Web Graphics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.