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);
        },
        1920,
        height: 1000
    })

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

原文地址:https://www.cnblogs.com/pjh7/p/8623351.html