LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
0, 0
CSS
body {
  background: lightblue;
}

#d {
  position: fixed;
  left: 10px;
  top: 10px;
  font-size: 50px;
  z-index: 1;
}

#left {
  width: 50%;
  float: left;
}

#left {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 50%;
  height: 100%;
  overflow: scroll;
}

#right {
  position: absolute;
  right: 0px;
  top: 0px;
  width: 50%;
  height: 100%;
  overflow: scroll;
}

#r {
  background: darkgreen;
  height: 1000000000px;
  display: block;
}

#e {
  background: pink;
  height: 1000000000px;
  display: block;
}
JS
var left = document.getElementById("left");
var right = document.getElementById("right");
var d = document.getElementById("d");
var e = document.getElementById("e");

left.addEventListener("scroll", update);
right.addEventListener("scroll", update);

function update(event) {
  //event.preventDefault();
  //event.stopPropagation();
  d.textContent = left.scrollTop + ", " + right.scrollTop;

  var evt = document.createEvent("MouseEvents");    
  evt.initMouseEvent("scroll", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  right.dispatchEvent(evt);
}
Term
Sat, 01/13/2018 - 16:17

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv