| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2555 人关注过本帖
标题:在母版页中层的弹出
只看楼主 加入收藏
zdloveday
Rank: 2
等 级:论坛游民
帖 子:221
专家分:96
注 册:2008-9-5
结帖率:68.89%
收藏
 问题点数:0 回复次数:2 
在母版页中层的弹出
以下是我的代码   大家帮我看看   我在普通的页面中能正常实现,但是一到母版页中就不能实现层的弹出效果了?
程序代码:
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Location.Master" AutoEventWireup="true" CodeBehind="AddNew.aspx.cs" Inherits="khfycn.admin.AddNew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
body{margin:0;padding:0;}
#bg{background:#000;position:absolute;left:0;top:0;filter:"Alpha(opacity=20)";opacity:0.2;display:none;}
#win{width:500px;height:500px;position:absolute;left:50%;top:50%;margin:-100px -100px 0;border:4px #F00 solid;background:#FFF;display:none;}
</style>

    <script type="application/javascript">
        var $ = function (id) { return document.getElementById(id); }
        function WinTip() {
            var win = new WinSize();
            var Tip = $("bg");    
            Tip.style.width = win.W + "px";
            Tip.style.height = win.H + "px";
            if (Tip.style.display == "block") {
                Tip.style.display = "none";
                $("win").style.display = "none"; 
            } else {
                Tip.style.display = "block";
                $("win").style.display = "block"; 
            }
        }
        function WinSize() //函数:获取尺寸
        {
            var winWidth = 0;
            var winHeight = 0;
            if (window.innerWidth)
                winWidth = window.innerWidth;
            else if ((document.body) && (document.body.clientWidth))
                winWidth = document.body.clientWidth;
            if (window.innerHeight)
                winHeight = window.innerHeight;
            else if ((document.body) && (document.body.clientHeight))
                winHeight = document.body.clientHeight;
            if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
                winHeight = document.documentElement.clientHeight;
                winWidth = document.documentElement.clientWidth;
            }
            return { "W": winWidth, "H": winHeight }
        }
</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div style="float:left; width:35px">
  <a  onclick="WinTip()" href="javascript:;"><img alt="打开" src="img/button_02.png" width="35px" height="26px" border="0" /></a> 
        <div id="bg" style="DISPLAY: none;" >
             <div id="win">
                <a href="javascript:;" onclick="WinTip()">关闭</a>
               <iframe src="pic.aspx" frameborder="0" scrolling="no" width="1000" height="100"></iframe>
           </div>
      </div>
  </div>                            
</asp:Content>

请大家帮我看看 在母版页中怎么弄呢?
2015-10-29 13:43
zdloveday
Rank: 2
等 级:论坛游民
帖 子:221
专家分:96
注 册:2008-9-5
收藏
得分:0 
有人吗?

不懂----就无耻的下问吧----
2015-10-29 14:43
zdloveday
Rank: 2
等 级:论坛游民
帖 子:221
专家分:96
注 册:2008-9-5
收藏
得分:0 
没人帮我解答一下哇

不懂----就无耻的下问吧----
2015-11-09 09:32
快速回复:在母版页中层的弹出
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016395 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved