文档
http://aui.github.io/artDialog/doc/index.html
引入文件
<script src="lib/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="css/ui-dialog.css">
<script src="dist/dialog-min.js"></script>
前端代码
<button value="http://img.xxx.com/a.png" onclick="viewImg(this)">浏览</button>
js代码
function viewImg(btnObj){
var top = btnObj.offsetTop -200;
var left = btnObj.offsetLeft ;
if(btnObj.value){
var html='<img src="'+btnObj.value+'" style="width: 640px;height:420px" />';
//var html='<img src="'+$('#'+domid).val()+'"</img>'
}else{
var html='没有图片';
}
art=dialog({title:'图片预览',content:html,lock:true,background: '#000',opacity: 0.45, left: left, top: top});
art.show()
return false;
//art.show();
}