本实例用到了jquery.imgbox.pack.js库。直接看代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>3种jQuery弹出大图效果</title>
<link rel="stylesheet" href="http://7u2iij.com1.z0.glb.clouddn.com/images_style.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.imgbox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#pic1").imgbox(); $("#pic2").imgbox({
'zoomOpacity' : true,
'alignment' : 'center'
}); $("#pic3").imgbox({
'speedIn' : 0,
'speedOut' : 0,
'alignment' : 'center',
'overlayShow' : true,
'allowMultiple' : false
});
});
</script>
</head>
<body>
<!-- 代码 BEGIN -->
<div id="content">
<h1>imgBox--图片点击放大示例</h1>
<hr />
<div id="images">
<a id="pic1" title="图片一" href="http://7u2iij.com1.z0.glb.clouddn.com/pic1.jpg"><img alt="" src="http://7u2iij.com1.z0.glb.clouddn.com/pic1.jpg" width="150" height="90" /></a>
<a id="pic2" title="图片二" href="http://7u2iij.com1.z0.glb.clouddn.com/pic2.jpg"/><img alt="" src="http://7u2iij.com1.z0.glb.clouddn.com/pic2.jpg" width="150" height="90" /></a>
<a id="pic3" title="图片三" href="http://7u2iij.com1.z0.glb.clouddn.com/pic3.jpg"><img alt="" src="http://7u2iij.com1.z0.glb.clouddn.com/pic3.jpg" width="150" height="90" /></a>
</div>
<div><a href="" target="_blank" class="download">本地下载</a></div>
</div>
<!-- 代码 END -->
<div style="text-align:center">
<p>文章来源:<a href="http://www.cnblogs.com/iyitong/" target="_blank">cyt静风</a></p>
</div>
</body>
</html>