Tell me, how can I implement a scroll, where is it missing? The page is built using position absolute and there is no skolla ... But you need to know when the user turns the wheel and how much. For example, blocks will move from the scroll.
The window.onscroll event does not handle it. the window itself remains motionless ...
Thank you in advance!
Here is an example! http://www.jandk.fr/
Found how to implement on a mousewheel, But still - are there any other ways to implement this? (They say that soon they will not support this method), and itβs not adaptive ... + there will be porridge on touch devices ... I really hope for your help!
var elem = document.getElementById('container'); if (elem.addEventListener) { if ('onwheel' in document) { elem.addEventListener("wheel", onWheel); } else if ('onmousewheel' in document) { elem.addEventListener("mousewheel", onWheel); } else { elem.addEventListener("MozMousePixelScroll", onWheel);} } else { // IE8- elem.attachEvent("onmousewheel", onWheel);} function onWheel(e) { e = e || window.event; var delta = e.deltaY || e.detail || e.wheelDelta; var info = document.getElementById('delta'); info.innerHTML = +info.innerHTML + delta; e.preventDefault ? e.preventDefault() : (e.returnValue = false);} #container { width: 200px; height: 200px; border: 1px solid black; background: #0FF; overflow: auto;} ΠΡΠΎΠΊΡΡΡΠΊΠ°: <span id="delta">0</span> <div id="container"> ΠΡΠΎΠΊΡΡΡΠΈ Π½Π°Π΄ΠΎ ΠΌΠ½ΠΎΠΉ. </div>