HTML代码
<div id="scrollidout" style="overflow: auto; overflow-y: hidden; ">
<div id="scrollidin" style="padding-top: 1px; height: 20px; width: 1000px"> </div>
</div>
<div class="resultcontent" style="overflow: auto; overflow-y: hidden; " id="resultcontent" >
SEARCH RESULTS HERE
<div id="scrollidin12" style="padding-top: 1px; height: 190px; width: 3200px">
klklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklk
lklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklkklklklklk
</div>
</div>
JAVASCRIPT CODE
$(function(){
$('#scrollidout').on('scroll', function(){
$('#resultcontent')
.scrollLeft($('#scrollidout').scrollLeft());
});
$('#resultcontent').on('scroll', function(){
$('#scrollidout')
.scrollLeft($('#resultcontent').scrollLeft());
});
});
加载时首先它在整个页面工作时起作用 但是当我改变div的内容时,#resultcontent&#34;使用Ajax,我无法使用顶部滚动条再次滚动div。我怎么解决这个问题?
答案 0 :(得分:0)
对你有帮助吗? https://developer.mozilla.org/fr/docs/Web/CSS/overflow
使用overflow : scroll
放置一个类以强制显示滚动条。