A light jQuery plugin for zoom
A light jQuery plugin for zooming svg.It is just 3 kb before gzip. 基于jQuery的简洁的svg缩放插件,普通压缩后仅3kb。
quick start1.add jquery and svg-zoom files
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script> <script src="/path/SvgZoom.min.js"></script>
2.select a svg element to init
var svgZoom = new SvgZoom('#svgId') configs If you want to override the defaults, you can optionally specify the arguments:
new SvgZoom('#svgId',{
mouseWheel: true,
zoomSpeed: 0.065,
maxZoom: Number.POSITIVE_INFINITY,
minZoom: 0.2,
initZoom: 1,
center: true,
viewClass: 'svgzoom-view',
//class selector depends on jq's version may be faild when IE,should replace with [class='classname']
zoomSelector: '',
dragCursorStyle: 'move'
})
methods
setZoom(zoom:Number)
setMouseWheel(enable:Boolean)
center
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。