버튼 클릭시, 현재 페이지 캡쳐하기
페이지 정보
작성자 서방님 댓글 0건 조회 438회 작성일 22-03-17 17:18본문
<button type="button" class="a_next ft" id="printScreenBtn">화면 캡쳐</button>
<script src="/webdata/js/html2canvas.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#printScreenBtn").bind("click", function(){
var canvasWidth = $(document).outerWidth();
var canvasHeight = $("#wrap").outerHeight();
let today = new Date();
html2canvas(document.getElementById("wrap"), {scale: 1, useCORS: true,onclone: function(document) {
}}).then(function(canvas) {
var el = document.getElementById("downbtn");
el.href = canvas.toDataURL("image/png");
el.download = "play_result_manager_"+today.getFullYear()+today.getMonth()+today.getDate()+today.getHours()+today.getMinutes()+today.getSeconds()+".png";
el.click();
});
});
});
</script>
댓글목록
등록된 댓글이 없습니다.
