ich habe Code-Bild zum Download:Doppelklick auf jQuery Mobile
<a href="$img" class="download-img" download><img src="$img"></a>
und ich habe Funktion Doppelklick von mobilen Geräten zu überprüfen:
var touchtime = 0;
$('.download-img').on('click', function() {
if(touchtime == 0) {
//set first click
touchtime = new Date().getTime();
} else {
//compare first click to this click and see if they occurred within double click threshold
if(((new Date().getTime())-touchtime) < 800) {
//double click occurred
alert("double clicked");
touchtime = 0;
} else {
//not a double click so set as a new first click
touchtime = new Date().getTime();
}
}
});
, wie ich diesen 2 Teil Codes kommen kann, Download-Bild von Doppelklick, aber nicht einfach
Statt "Join this 2 Teile von Codes" sind Sie stattdessen bedeutet, den Download zu verhindern, wenn es nur ein einziger Klick ist? – Taplar