zoukankan      html  css  js  c++  java
  • JS 显示图片层

    //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" />"; } }

      

  • 相关阅读:
    Vue学习手记01-安装和项目创建
    [Powershell] FTP Download File
    [PowerShell] Backup Folder and Files Across Network
    SSRS 请求并显示SharePoint人员和组字段
    Beta 冲刺 (2/7)
    Beta 冲刺 (1/7)
    BETA 版冲刺前准备
    事后诸葛亮
    Alpha 答辩总结
    α冲刺 (10/10)
  • 原文地址:https://www.cnblogs.com/lengv10/p/3787891.html
Copyright © 2011-2022 走看看