Showing
1 changed file
with
13 additions
and
31 deletions
@@ -25,10 +25,11 @@ | @@ -25,10 +25,11 @@ | ||
25 | <table id="screenshotsTable"> | 25 | <table id="screenshotsTable"> |
26 | </table> | 26 | </table> |
27 | </div> | 27 | </div> |
28 | -<div style="display: none"> | ||
29 | - <div id="dlg" class="datagrid-toolbar" style="padding:5px;"> | ||
30 | - <img id="simg" src="" alt="" width="800"> | ||
31 | - </div> | 28 | + |
29 | +<div id="w" class="easyui-window" title="预览" data-options="modal:true,closed:true" style="width:500px;height:600px;padding:10px;"> | ||
30 | + <div align="center"> | ||
31 | + <img id="showImg" height="500px;" width="400px;" onclick="window.open(this.src)"/> | ||
32 | + </div> | ||
32 | </div> | 33 | </div> |
33 | <script> | 34 | <script> |
34 | $(function() { | 35 | $(function() { |
@@ -55,33 +56,8 @@ $(function() { | @@ -55,33 +56,8 @@ $(function() { | ||
55 | 56 | ||
56 | loadMainList(); | 57 | loadMainList(); |
57 | 58 | ||
58 | - //放大图片预览 | ||
59 | - $(".pimg").click(function(){ | ||
60 | - alert("****"); | ||
61 | - var _this = $(this);//将当前的pimg元素作为_this传入函数 | ||
62 | - var src = _this.attr("src"); | ||
63 | - alert(src); | ||
64 | - //var index = src.indexOf("?"); | ||
65 | - //src = src.substring(0, index); | ||
66 | - //window.open(src); | ||
67 | - download(src); | ||
68 | - }); | ||
69 | - | ||
70 | }); | 59 | }); |
71 | 60 | ||
72 | -function download(url) { | ||
73 | - $('#dlg').dialog({ | ||
74 | - title: '预览', | ||
75 | - width: 800, | ||
76 | - height: 600, | ||
77 | - resizable: false, | ||
78 | - closed: false, | ||
79 | - cache: false, | ||
80 | - modal: true | ||
81 | - }); | ||
82 | - $("#simg").attr("src", url); | ||
83 | -} | ||
84 | - | ||
85 | function loadMainList(){ | 61 | function loadMainList(){ |
86 | $("#screenshotsTable").myDatagrid({ | 62 | $("#screenshotsTable").myDatagrid({ |
87 | fit: true, | 63 | fit: true, |
@@ -109,8 +85,8 @@ function loadMainList(){ | @@ -109,8 +85,8 @@ function loadMainList(){ | ||
109 | var imageStr = "<table><tbody><tr>"; | 85 | var imageStr = "<table><tbody><tr>"; |
110 | if(value != null){ | 86 | if(value != null){ |
111 | for (var i = 0 ;i < value.length; i++){ | 87 | for (var i = 0 ;i < value.length; i++){ |
112 | - imageStr += "<td><img height='200px;' width='150px;' class='pimg' src='"+value[i].url+"'/>"; | ||
113 | - //imageStr += "<br>创建时间:"+value[i].createTimeStr+"<br>操作人:"+value[i].createUserName; | 88 | + imageStr += "<td><a href='javascript:void(0)' onclick='openModal("+"\""+value[i].url+"\""+")'><img height='200px;' width='150px;' src='"+value[i].url+"'/></a>"; |
89 | + imageStr += "<br><font color='black'>创建时间:"+value[i].createTimeStr+"<br>操作人:"+value[i].createUserName + "</font>"; | ||
114 | imageStr += "</td>"; | 90 | imageStr += "</td>"; |
115 | if((i+1) % 5 == 0 && 0 != i && i != (value.length - 1)) { | 91 | if((i+1) % 5 == 0 && 0 != i && i != (value.length - 1)) { |
116 | imageStr += "</tr><tr>"; | 92 | imageStr += "</tr><tr>"; |
@@ -136,6 +112,12 @@ function loadMainList(){ | @@ -136,6 +112,12 @@ function loadMainList(){ | ||
136 | }); | 112 | }); |
137 | } | 113 | } |
138 | 114 | ||
115 | +function openModal(imageUrl){ | ||
116 | + $("#showImg").attr("src",imageUrl); | ||
117 | + $("#w").window("open"); | ||
118 | +} | ||
119 | + | ||
120 | + | ||
139 | </script> | 121 | </script> |
140 | </body> | 122 | </body> |
141 | </html> | 123 | </html> |
-
Please register or login to post a comment