是的,使用 jquery mobile
中提到的 文档 中的 taphold 事件可以实现此功能。(其他事件我没有尝试过)
$(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
}
});
a
标签,因为我没有iOS设备进行测试。//这只是一个参考,证明taphold函数是有效的。 - Pritish Vaidya