zoomAndPan

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Thuộc tính zoomAndPan chỉ định liệu tài liệu SVG có thể được phóng to và kéo hay không.

Phóng to trong ngữ cảnh này nghĩa là hiệu ứng của một phép biến đổi scale và translate bổ sung trên mảnh tài liệu SVG ngoài cùng.

Kéo biểu thị một phép biến đổi tịnh tiến (tức là dịch chuyển) trên một mảnh tài liệu SVG để đáp ứng một hành động giao diện người dùng.

Bạn có thể dùng thuộc tính này với các phần tử SVG sau:

Ví dụ

html
<svg
  viewBox="0 0 200 200"
  xmlns="http://www.w3.org/2000/svg"
  zoomAndPan="disable">
  <filter id="diffuseLighting" x="0" y="0" width="100%" height="100%">
    <feDiffuseLighting in="SourceGraphic" zoomAndPan="1">
      <fePointLight x="60" y="60" z="20" />
    </feDiffuseLighting>
  </filter>

  <rect x="0" y="0" width="200" height="200" filter="url(#diffuseLighting)" />
</svg>

Lưu ý sử dụng

Giá trị disable | magnify
Giá trị mặc định magnify
Có thể hoạt ảnh Không

Thông số kỹ thuật

Specification
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
# ZoomAndPanAttribute

Khả năng tương thích trình duyệt

svg.elements.svg.zoomAndPan

svg.elements.view.zoomAndPan