首页 > Web开发 > 详细

JS 显示图片层

时间:2014-06-14 17:19:03      阅读:488      评论:0      收藏:0      [点我收藏+]

 

//imgFrame显示层,imgbox显示的内容
<div id="imgFrame">       
     <div><a href="javascript:close();">关闭</a></div>         
     <div id="imgbox"></div>     
</div> 

//img路径   <img src=‘<%#(Eval("picture","{0}").ToString()=="")?"../images/noimg.gif":Eval("picture")%>‘ width="90" height="50" onclick="showOriginal(‘<%#Eval("picture")%>‘,event);"> //层的关闭按钮方法 function close() { document.getElementById("imgFrame").style.display = "none"; } //层显示的方法 function showOriginal(img,e) { // document.getElementById("imgFrame").style.top = mousePos(e).x; // document.getElementById("imgFrame").style.left = mousePos(e).y; // document.getElementById("imgFrame").style.zIndex=1000; // document.getElementById("imgFrame").style.position = "absolute"; if(img != "" && img != null) { document.getElementById("imgFrame").style.display = "block"; document.getElementById("imgbox").innerHTML = "<img src=‘" + img + "‘ width=\"500\" height=\"500\" />"; } else { document.getElementById("imgFrame").style.display = "block"; document.getElementById("imgbox").innerHTML = "<img src=‘../images/noimg.gif‘ width=\"500\" height=\"500\" />"; } }

  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

JS 显示图片层,布布扣,bubuko.com

JS 显示图片层

原文:http://www.cnblogs.com/lengv10/p/3787891.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!