如何使用javascript / jQuery将图像直接保存到iPhone / Android照片库?

时间:2019-06-15 03:57:13

标签: javascript jquery

我有一些代码可以将图像直接保存到设备中。这在桌面上完美工作。

function saveQR() {
    var link = document.createElement('a'),
        cpdTxt = '已保存到系统相册',
        qrSve = function() {
            $('.msg').animate({
                top: '48%'
            });
            $('.modal').fadeOut(300);
        };
    link.href = './assets/downloads/qr.png';
    link.download = 'myQR.png';
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
    $('.msg').text(cpdTxt.replace());
    $('.msg').animate({
        top: '50%'
    });
    $('.ref-lnkcpy').fadeIn(400);
    setTimeout(qrSve, 2000);
}

However, when I tried it using an iPhone, it just opens the image to another tab. Is there a way to resolve this?

0 个答案:

没有答案