如何將我的div下載爲圖像? (在JavaScript中,jQuery的或PHP)將HTML5作爲圖像下載
我有一個簡單的HTML代碼:
<div id="downloadThis">
<div style="width: 200px; height: 100px; background: red"></div>
<div style="width: 200px; height: 100px; background: blue"></div>
</div>
<button id="downloader" onClick="download('downloadThis')">Download</button>
我想下載它作爲一個形象:
<script>
function download(id){
document.getElementById(id).downloadAsImage("jpeg");
}
</script>
檢查文檔https://github.com/kiloev/html-to-image – Ananth 2015-02-08 15:50:22
我想下載一切爲一個圖像 – Tomato 2015-02-08 15:51:35