A jQuery plug-in that synchronizes the scrolling of several containers with scrollbars, such as iframe.(It works like bidirectional bindings, which let containers' scrollTop and scrollLeft synchronous, and using conditional bidirectional bindings which ca
npm install jquery-scrollsync
npm install jquery-scrollsync
`
Usage
默认同步滚动:
`
$('selector').scrollsync()
`
取消同步滚动:
`
$('selector').closeScrollsync()
`
不同步横向滚动条:
`
$('selector').scrollsync({x_sync: false})
`
不同步纵向滚动条:
`
$('selector').scrollsync({y_sync: false})
`
使用smartscroll(使滚动事件执行频率降低,默认10ms内只触发一次):
`
$('selector').scrollsync({use_smartscroll: true})
`
使用smartscroll且自定义触发间隔时间为30ms:
`
$('selector').scrollsync({smartscroll_delay: true, smartscroll_delay: 30})
``