代码改变世界

.今天公司项目中的弹层效果

2012-08-15 17:56  C#与.NET探索者  阅读(156)  评论(0编辑  收藏  举报

记录下来备忘
<style type="text/css">
#top_NewsBg
{
    display:none;
    background-color:#000;
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    z-index:999;
}
#top_NewsDiv{display:none; background-color:#fff; position:absolute; top:50%; left:50%; height:235px;_height:225px;!height:225px; margin-top:-150px; width:468px; margin-left:-250px;z-index:1100;}
</style>
<script language="javascript" type="text/javascript">
    function top_showNewsDiv(Fid, Amount) {
        $("#top_NewsIframe").attr("src", "/<%=Common.Para.siteHead %>u/ShowLogin.aspx?Fid="+Fid+"&Amount="+Amount);
        var scrolltop = $(document).scrollTop();
        var h = $(document).height() - 4 + scrolltop;
        $("#top_NewsBg").css("height", h + "px").css("width", $(document).width() - 17 + "px");
        $("#top_NewsBg").fadeTo("slow",0.5);
        $("#top_NewsDiv").fadeIn(500);
    }
    function close_top_NewsDiv() {
        $("#top_NewsDiv").fadeOut("fast");
        $("#top_NewsBg").fadeOut("fast");
    }
</script>
<div id="top_NewsBg"></div>
<div id="top_NewsDiv"><iframe id="top_NewsIframe" style="width:100%;height:235px;_height:225px;!height:225px;" frameborder="0" scrolling="no"></iframe>
</div>

子页面中调用
function closediv() {
            parent.close_top_NewsDiv();
 }
关闭弹层