• showPop


    function G(id){return document.getElementById(id);}

    var popLoaded=false;

    function showPop(url){

    var objSha = G("shadowDiv");
    objSha.style.height = document.body.scrollHeight+"px";
    objSha.style.width= document.body.scrollWidth+"px";
    objSha.style.left = 0;
    objSha.style.top = 0;

    /*if(!popLoaded){

    try{
    G("ifr").src= url;
    popLoaded=true;
    }catch(e)
    {
    try{
    document.frames["ifr"].location = url;
    popLoaded=true;
    }catch(e){
    popLoaded=false;
    }
    }
    }*/


    if(!popLoaded){
    try{
    G("ifr").src= url;
    }catch(e)
    {
    document.frames["ifr"].location = url;
    }
    }

    var objPop = G("popDiv");
    var sClientWidth = document.body.clientWidth;
    var sClientHeight = document.body.clientHeight;
    var sScrollTop = document.body.scrollTop;
    var sleft = (document.body.clientWidth / 2) - 0;
    var iTop = -80 + (sClientHeight / 2 + sScrollTop) - 0;
    var sTop = iTop > 0 ? iTop : (sClientHeight / 2 + sScrollTop) - 225;
    if(sTop < 1) sTop="20px";
    if(sleft < 1) sleft="20px";

    if(screen.width < 801){

    objPop.style.left = "20px";
    objPop.style.top = "20px";
    objPop.style.height = "350px";

    }else if(screen.width > 1024){

    objPop.style.left = "300px";
    objPop.style.top = "170px";
    objPop.style.height = "500px";

    }else{

    objPop.style.left = "180px";
    objPop.style.top = "120px";
    objPop.style.height = "500px";
    }

    objSha.style.display = "";
    objPop.style.display = "";

    }

    function hidePop(){

    G("popDiv").style.display = "none";
    G("shadowDiv").style.display = "none";


    }
    ----------------------------------------------------------------------------------------
    <div id="shadowDiv" style="display:none;100%;height:100%;position:absolute;top:0px;left:0px;background-color:#FFF;filter: alpha(opacity=50);opacity:0.4;z-index:65534;border:solid 0px blue"></div>

    <div id="popDiv" style="border:2px solid #97ACD2;display:none;position:absolute;top:0px;left:0px;650px;height:500px;overflow-y:auto;z-index:65535;background-color:#fff;">
    <div id="popTitle" style="border-bottom:0px solid #ccc;height:25px;">
    <strong style="float:left;margin-left:15px;font-size:14px;margin-top:5px;">选择主题图片</strong><a href="###" onclick="hidePop()" id="dialogBoxClose" style="color:#999999;text-decoration:none;float:right;margin-right:15px;font-size:14px;margin-top:5px;">X 关闭</a>
    <div class="clear"></div>
    </div>
    <div>
    <iframe id="ifr" frameborder="0" style="100%;height:460px;" scrolling="no" src="about:blank"></iframe></div>
    </div>
    </div>
    ----------------------------------------------------------------------------------------
    <a href="###" onclick="javascript:showPop('/n/popup_setpic.aspx')">点此处选择一张主题图片</a>
  • 相关阅读:
    【异常】No ManagedConnections available within configured blocking timeout
    【异常】Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException
    【Redis】:Jedis 使用
    【异常】INFO: TopologyManager: EndpointListener changed ...
    【Java】JDK类 CountDownLatch
    【WEB】一个简单的WEB服务器
    【JAVA】Socket 编程
    【JBOSS】 JBOSS目录结构
    [SE0]简单的搜索引擎原理
    【ORACLE】 表空间信息
  • 原文地址:https://www.cnblogs.com/lixinsheng/p/1213487.html
Copyright © 2020-2023  润新知