I would like to know if there is any possibility to trigger the "Save Image" touch callout on iOS and Android with Javascript. The callout is triggered by a longpress, but even if I try to simulate this, it won't work.
I would like to achieve something likes this:
jQuery('img').openCallout();
So far I tried this:
jQuery: jQuery('img').contextmenu();
jQuery Mobile: jQuery('img').taphold();
Yes ,this is possible using the jquery mobile
as mentioned in the docs,using the taphold event.(Other events, I didn't try)
As illustrated in this fiddle (Till now tested in the following as shown here)
$(function() {
$("div.box").bind("taphold", tapholdHandler);
function tapholdHandler(event) {
alert('Do you want to save the image or however it works in ipad');
var a = document.createElement('a');
a.href = "http://i.imgur.com/JzdY53y.jpg";
a.download = 'JzdY53y.jpg';
alert("goes till here1"); // just a check
a.click();
alert("goes til here 2"); //just a check
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With