My code is...
var timer;
var func = function () {
$("body").append("1");
};
$(document).on('mousedown' , 'a' , function(e){
timer = setTimeout(func, 1000);
}).on('mouseup mouseleave' , 'a' , function(e){
clearTimeout(timer);
});
Everything working. But when I set this function to some link like <a href="http://google.com">text</a>
I need to set return false; (not redirect to the url or another onclick() functions)
Where return false; can I set in ? Or another solution ?
PS : And I will my link will work normally when click by normal clicking
Playground : http://jsbin.com/iwilop/1/edit