弱小的基于jQuery的图片切割插件,图片抉择框能够按肯定的比例完成。
实例代码:
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="//www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>imgAreaSelect jQuery plugin - Examples</title>
<script src="//ajax.谷歌apis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="scripts/jquery.imgareaselect.pack.js"></script>
<link rel="stylesheet" type="text/css" href="css/imgareaselect-default.css" />
</head>
<body>
<div>
<script type="text/javascript">
$(function () {
$('#ladybug_ant').imgAreaSelect({ maxWidth: 200, maxHeight: 150, handles: true });
$('#bee').imgAreaSelect({ aspectRatio: '4:3', handles: true });
$('#duck').imgAreaSelect({ x1: 120, y1: 90, x2: 280, y2: 210 });
});
</script>
</div>
<p style="text-align: center;">
<img id="ladybug_ant" src="ladybug_ant.jpg" alt="A ladybug being harassed by an ant." title="A ladybug being harassed by an ant.">
</p>
<p style="text-align: center;">
<img id="bee" src="bee.jpg" alt="Busy bee" title="Busy bee">
</p>
<p style="text-align: center;">
<img id="duck" src="duck.jpg" alt="Why did the duck cross the road?" title="Why did the duck cross the road?">
</p>
</body>
</html>
[/code]
实例代码:
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="//www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>imgAreaSelect jQuery plugin - Examples</title>
<script src="//ajax.谷歌apis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="scripts/jquery.imgareaselect.pack.js"></script>
<link rel="stylesheet" type="text/css" href="css/imgareaselect-default.css" />
</head>
<body>
<div>
<script type="text/javascript">
$(function () {
$('#ladybug_ant').imgAreaSelect({ maxWidth: 200, maxHeight: 150, handles: true });
$('#bee').imgAreaSelect({ aspectRatio: '4:3', handles: true });
$('#duck').imgAreaSelect({ x1: 120, y1: 90, x2: 280, y2: 210 });
});
</script>
</div>
<p style="text-align: center;">
<img id="ladybug_ant" src="ladybug_ant.jpg" alt="A ladybug being harassed by an ant." title="A ladybug being harassed by an ant.">
</p>
<p style="text-align: center;">
<img id="bee" src="bee.jpg" alt="Busy bee" title="Busy bee">
</p>
<p style="text-align: center;">
<img id="duck" src="duck.jpg" alt="Why did the duck cross the road?" title="Why did the duck cross the road?">
</p>
</body>
</html>
[/code]
标签: imgAreaSelect 图片切割
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。