document.addEventListener('scroll', function(event) { if (event.target.id === 't_r_content') { // or any other filtering condition var c = document.getElementById(event.target.id).scrollTop; document.getElementById("cl_freeze").scrollTop = c; console.log(c); } else if (event.target.id === 'cl_freeze') { // or any other filtering condition var a = document.getElementById(event.target.id).scrollTop; document.getElementById("t_r_content").scrollTop = a; console.log(a); } }, true );
滚动的时候会相互影响,记录下问题,还没有解决