yangwan

长按识别二维码

tips[index].onclick=function(){

var w = $("#app").width();
var h = $("#app").height();
var canvas=document.createElement("canvas")
canvas.width = w * 2;
canvas.height = h * 2;
canvas.style.width = w + "px";
canvas.style.height = h + "px";
var context = canvas.getContext("2d");
context.scale(2,2);

html2canvas($(\'#app\'),{
canvas:canvas,
onrendered: function (canvas) {

setTimeout(function(){
$(\'#app\').css(\'display\',\'none\')

$("#showimg").show()
$("#showimg").attr(\'src\', canvas.toDataURL());
},2000)



}
})

}

发表于 2019-02-15 16:59  我的代码笔记  阅读(699)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2021-12-31
  • 2021-08-01
  • 2021-12-15
  • 2021-12-03
  • 2021-12-15
  • 2022-01-02
  • 2021-11-18
  • 2021-12-05
猜你喜欢
  • 2021-06-23
  • 2021-06-14
  • 2021-12-15
  • 2021-12-05
  • 2021-12-15
  • 2021-12-15
  • 2021-12-05
相关资源
相似解决方案