html2canvas 根据DIV 生成图片

使用方法:

html2canvas($(".meeting-contractor-view-content"), {

        onrendered: function (canvas) {
            var url = canvas.toDataURL();//图片地址
            $item.find("img").attr("src", url);
            self.len++;
            var set = setTimeout(function () {
                self.viewinit();
                clearTimeout(set);
            }, 1000);
        },
        width: 1920,
        height: 1000
    })

 

js库下载地址:https://github.com/pijiahao/Demo-Project 

 

posted on 2018-03-22 14:15  皮佳豪  阅读(1321)  评论(0编辑  收藏  举报

导航