js实现点击保存图片
html:

<img style="-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;" src="{$shareloan}" width="90%" id="testImg">

 <span id="saveImg" onclick="save()" style="margin-bottom:.6rem;margin-top:.6rem;">保存图片</span>

js:

function save() {

    var img = document.getElementById("testImg");

    var alink = document.createElement("a");

    alink.href = img.src;

    alink.click();

}

效果图:

js实现点击保存图片

js实现点击保存图片

更多技术问题,可前往:http://sucai.gxyourui.cn/Home/Article/blog.html

相关文章:

  • 2022-12-23
  • 2022-01-06
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2021-04-23
  • 2021-07-31
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2021-12-18
  • 2021-11-19
  • 2021-06-12
  • 2021-04-18
相关资源
相似解决方案