Pretty much title, I would like to allow scrolling in a DIV, but disable click events. Does anyone know any way this could be accomplished?
Thank you!
For me create a special class that prevents click events then wrap these element(s) with a scrollable container.
<div class="scrollable-div">
<div class="child-div noclick">
//anything else
</div>
</div>
and your js would look like
$('.noclick').click(function(event){
// prevent default behavior of click
event.preventDefault();
return false;
});
Hope that helps
var myDiv = document.querySelector('#myDiv');
myDiv.addEventListener('click', function(){
return false
});
$('div_selector').off('click').myDiv { pointer-events: none; }