<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>jquery 动态添加删除移动dom元素</title>
<script src="js/jquery-1.7.2.js"></script>
<script src="js/html2canvas.js"></script>
<script type="text/javascript">
function queryImgs(){
var currentobj = document.getElementById("imgtest");
html2canvas( [ currentobj ], {
onrendered: function(canvas) {
document.body.appendChild(canvas);
},
allowTaint:true
});
}
</script>
</head>
<body>
<div id="fields">
<div class="field">
字段名称:
<input type="text" name="fieldTitle">
<input type="button" class="up" value="上移" onclick="up(this);"/>
<input type="button" class="down" value="下移" onclick="down(this);"/>
<input type="button" class="delete" value="delete"/><br><br><br>
<input type="button" class="up" value="生成图片" onclick="queryImgs();"/>
<br><br><br>
<div class="imgtest" id="imgtest">
<p>this is a test</p>
<p><img src="images/logo_white.png" width="270" height="129"/></p>
</div>
</div>
</div>
<input type="button" value="添加字段" id="add">
<canvas id="myCanvas" style="z-index: 999;">your browser does not support the canvas tag </canvas>
</body>
</html>