0
我激活和關閉變焦的行爲出現在http://bl.ocks.org/benzguo/4370043時:D3-JS鼠標滾輪的問題來啓用和停用縮放行爲
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
如何建立一個默認的鼠標滾輪行爲以滾動頁面?或者,示例中顯示的方式不是停用縮放行爲的最佳方法嗎?
我使用3.3.2,這需要稍作修改。你必須使用(「wheel.zoom」,null) – 2014-01-10 08:13:48