Make two divs share the same scrollbar?

前端 未结 2 629
长情又很酷
长情又很酷 2021-02-14 20:32

Given two divs that represent columns embedded in a larger div. If the \"!stuff\" html represents many rows of data that would exceed the height of container, how do I set it u

2条回答
  •  温柔的废话
    2021-02-14 20:49

    Html

    !Stuff

    javascript function

    function OnScroll(div) {
    var div1 = document.getElementById("col1");
    div1.scrollTop = div.scrollTop;}
    

提交回复
热议问题