标签:
srcDiv has visible horizontal scrollbar.(style="overflow:auto;")
targetDiv has no scrollbar.(style="overflow:hidden;")
For instance, srcDiv is a tableview without tableheader, targetDiv is a tableheader only. When horizontally scrolling srcDiv, header div should scroll the the same distance accordingly.
function syncDivsScrollPos() { $(‘#srcDiv‘).on(‘scroll‘, function () { $(‘#targetDiv‘).scrollLeft($(this).scrollLeft()); }); }
Keep two divs sync scroll and example
标签:
原文地址:http://www.cnblogs.com/webglcn/p/4701726.html