I would like to disable the
<div id="street-view"></div>
element from dragging while keeping the scroll functionality.
I think I’ve tried anything I could find on the internet and yet nothing has helped.
Things I’ve tried:
document.getElementById("street-view").onmousedown = function () {
document.getElementById("street-view").style.pointerEvents = "none";
- Couldnt find any way to get scroll back to work
- When putting anything on top of
document.getElementById("street-view").style.pointerEvents = "none";
line – the onmouse event wouldnt execute.
<div id="street-view" draggable="false"></div>
Setting property of the container and any of its child didnt work out for me.
Nor any of these
document.getElementById("street-view").onmousedown = function (e) {
e.preventDefault();
return false;
};
Please help 🙂