Answer the question
In order to leave comments, you need to log in
How to make click prevent in draggable?
Welcome all!
There is an SVG map:
<div class="map-rent">
<div class="map-build">
<?=$row->svg?>
</div>
</div>
$('.map-build').draggable(
{
drag: function (event, ui) {
}
}
);
...
.draggable({
...
start: function(event, ui) {
ui.helper.bind("click.prevent",
function(event) { event.preventDefault(); });
},
stop: function(event, ui) {
setTimeout(function(){ui.helper.unbind("click.prevent");}, 300);
}
...
})
Answer the question
In order to leave comments, you need to log in
Try event.preventDefault(); replace with console.log(event.type). Find out what events are triggered
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question