<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="jquery-1.2.6.pack.js" type="text/javascript"></script>
<script src="yuImgCut.js" type="text/javascript"></script>
<script>
$(document).ready(function (){
var imgCut1=new ImgCut("showHere","http://pic.52photoshop.cn/GP131_350A.jpg",150,200,100,100);
var imgCut2=new ImgCut("showHereToo","http://pic.52photoshop.cn/GP131_350A.jpg",80,100,50,100);
$(".test input").eq(0).click(function(){alert('截图尺寸:'+imgCut1.CutW+'x'+imgCut1.CutH+'\n截图位置(相对于原始图左上角):'+imgCut1.GetCutLeft()+','+imgCut1.GetCutTop()+'\n原始图当前尺寸:'+imgCut1.GetImgWidth()+"x"+imgCut1.GetImgHeight());});
$(".test input").eq(1).click(function(){alert('截图尺寸:'+imgCut2.CutW+'x'+imgCut2.CutH+'\n截图位置(相对于原始图左上角):'+imgCut2.GetCutLeft()+','+imgCut2.GetCutTop()+'\n原始图当前尺寸:'+imgCut2.GetImgWidth()+"x"+imgCut2.GetImgHeight());});
});
</script>
<link href="yuImgCut.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="showHere"></div>
<div class="test"><input type="button" value="查看参数"/></div>
<br/>
<div id="showHereToo"></div>
<div class="test"><input type="button" value="查看参数"/></div>
</body>
</html>
- 1
- 2
前往页