Reputation: 1243
I want change event drag and drop, to click event for my objects. I try this code
$("a").draggable({
start: function (event, ui) {
$(this).trigger("click");
}
});
But not work :(
UPDATE:
I try this code:
document.ondragstart = function () {
return false;
};
document.onmouseup = function (a, b) {
$(this).trigger("click");
};
But trigger click still not work
Upvotes: 1
Views: 306
Reputation: 1243
I found just such a solution
var url = null;
$("a").mousedown(function () {
url = $(this).attr("href");
$(window).mousemove(function () {
$(window).unbind("mousemove");
});
});
$(window).mouseup(function () {
$(window).unbind("mousemove");
if (url != null) {
location.href = url;
}
});
Upvotes: 0
Reputation:
Try with this modification:
$("a").draggable({
start: function (event, ui) {
$(--your-button-element-here-).click();
}
});
Upvotes: 1