Home › Forums › CSS › Scrolling Layered Divs › Reply To: Scrolling Layered Divs
November 17, 2015 at 1:03 am
#234965
Shikkediel
Participant
The quick fix could be to add pointer-events: none
to the CSS of the overlaying divs. That’s is, if there are no links in them or anything. Another option would be to ‘redirect’ the mousewheel event. It would be a lot trickier with touch, I suspect that will require quite a bit of code to do right…
I made a plugin at some point though that could do the job, it’s meant to do a smoothscroll but you could set the tempo
(duration) to 1ms.
http://ataredo.com/morphology/lucidscroll/
It uses jQuery :
$(function() {
// you can give all divs on top the below class
$('.overlayingdiv').impulse({
target: $('#background'),
tempo: 1
});
});
Here’s a pen where you could try it out :
$('#container').impulse({
target: $(window),
tempo: 1,
propagate: false
});