引入js和css
<link href="css/prettyPhoto.css" rel="stylesheet"/>
<script src="js/jquery.prettyPhoto.js"></script>
事件
<a href="#" rel="prettyPhoto" title="bpm image" style="display:none"></a>
设置
<script type="text/javascript">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
theme:'light_square', //'dark_rounded'
show_title: false,
social_tools: false,
keyboard_shortcuts: true
});
});
</script>
触发
可以自己绑定到某个button的click事件
<script type="text/javascript">
function viewPng(){
var png = 'xxx.png';
$.prettyPhoto.open(png);
}
</script>