I work with this, and realized that links always get fired if you drag them. I would like to avoid that, and coded this:
$("div").drag(function() {
alert("Link should not be clickable while dragging.");
$("div a").css("pointer-events", "none");
});
div {
padding: 10px;
background-color: yellow;
display: inline-block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div><a href="https://www.wikipedia.org/">Wikipedia</a></div>
Unfortunately, the .drag(function() {
does not exist. Is there another way to code it like that?
And yes, I have already read this article. I have tried all what is written there, but was not able to fix it.
Would be very thankful for help! <3