如何使用Javascript设置窗口缩放?
在html+SVG中如何使用Javascript设置窗口缩放?,javascript,jquery,html,css,svg,Javascript,Jquery,Html,Css,Svg,在html+SVG中 html, body { width: 100%; height: 100%; margin: 0; padding: 0; } #svgWrapper { position: relative; overflow: hidden; width: 2614px; height: 1991px; } #svg { position: absolute; margin: 0 aut
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#svgWrapper {
position: relative;
overflow: hidden;
width: 2614px;
height: 1991px;
}
#svg {
position: absolute;
margin: 0 auto;
width: 2614px;
height: 1991px;
}
SVG图像非常大(地铁地图)
正文有一个SVG,这个操作应该在手机上进行
当您单击SVG的一个元素时,我想创建并放大中心的元素
下面的代码将元素放置在中心
windo.innerWidth()显示不正确,是否使用SVG中的缩放
如何更改窗口本身的缩放级别
setCenterWithStationId: function (station_id){
station = Snap.select(".station#"+station_id);
bound = station.getBBox()
var half_width = window.innerWidth/2
var half_height = window.innerHeight/2
window.scrollTo(bound.x - half_width, bound.y - half_height);
}
你用谷歌翻译吗?对不起。已翻译。您可以使用库进行缩放--