viernes, 19 de agosto de 2016

Scroll


http://stackoverflow.com/questions/3934271/horizontal-scrollbar-on-top-and-bottom-of-table

HTML:
< div class="wrapper1">
  < div class="div1">
< /div> < div class="wrapper2"> < div class="div2"> < /div> < /div>
CSS:
.wrapper1, .wrapper2 {
  width: 300px;
  overflow-x: scroll;
  overflow-y:hidden;
}

.wrapper1 {height: 20px; }
.wrapper2 {height: 200px; }

.div1 {
  width:1000px;
  height: 20px;
}

.div2 {
  width:1000px;
  height: 200px;
  background-color: #88FF88;
  overflow: auto;
}
JS:
$(function(){
  $(".wrapper1").scroll(function(){
    $(".wrapper2").scrollLeft($(".wrapper1").scrollLeft());
  });
  $(".wrapper2").scroll(function(){
    $(".wrapper1").scrollLeft($(".wrapper2").scrollLeft());
  });
});