Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pointer events on click but not on scroll

Is it possible to allow click but not scroll events?

pointer-events: none;

Will disable both types of inputs, I would like to disable only scroll. Any other ideas for workarounds?

like image 259
edencorbin Avatar asked Oct 17 '16 16:10

edencorbin


People also ask

Is scrolling a pointer event?

The pointer issued a scroll event. Scrolling the scroll wheel on a mouse is an example of an event that would create a PointerScrollEvent.

Does Safari support pointer events?

CSS pointer-events (for HTML) is Fully Supported on Safari 12, which means that any user who'd be accessing your page through Safari 12 can see it perfectly.

What are the pointer events?

Pointer events are DOM events that are fired for a pointing device. They are designed to create a single DOM event model to handle pointing input devices such as a mouse, pen/stylus or touch (such as one or more fingers). The pointer is a hardware-agnostic device that can target a specific set of screen coordinates.


1 Answers

Add this css:

.stopScroll{
height:100%;
overflow:hidden;
}

Then in jQuery:

$('body').addClass('stopScroll');

Look at the fiddle:https://jsfiddle.net/26dct8o3/1/

Would help if you are looking for this. Otherwise let me know in comments if this is not what you want.

like image 59
Aakash Thakur Avatar answered Nov 15 '22 00:11

Aakash Thakur