【发布时间】:2013-04-07 22:14:56
【问题描述】:
我激活和停用缩放行为,如 http://bl.ocks.org/benzguo/4370043 所示:
var zoom = d3.behavior.zoom().on("zoom", rescale)
// after adding the handler, the mouse wheel will still scroll the page
// activate
svg_g_element.call(zoom)
// now, the mouse wheel zoom
// desactivate
svg_g_element.call(d3.behavior.zoom().on("zoom")
// now, the mouse wheel will neither zoom nor scroll while over the svg_g_element
如何建立默认的鼠标滚轮行为来滚动页面?或者示例中显示的方式不是停用缩放行为的最佳方式?
【问题讨论】:
标签: javascript svg d3.js zooming mousewheel