Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/477.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 禁用html中的框架_Javascript_Popupwindow - Fatal编程技术网

Javascript 禁用html中的框架

Javascript 禁用html中的框架,javascript,popupwindow,Javascript,Popupwindow,我有一个页面,我在其中填充一个弹出屏幕,该页面由一些帧组成,当我点击一个链接时,该链接必须填充一个弹出窗口。它正确地填充窗口,但html页面单独获得块中的背景,而帧不获得背景块 请参阅图片以供参考,我还将跳过我用于此目的的文件: POPUP.JS //SETTING UP OUR POPUP //0 means disabled; 1 means enabled; var popupStatus = 0; //loading popup with jQuery magic! function

我有一个页面,我在其中填充一个弹出屏幕,该页面由一些帧组成,当我点击一个链接时,该链接必须填充一个弹出窗口。它正确地填充窗口,但html页面单独获得块中的背景,而帧不获得背景块

请参阅图片以供参考,我还将跳过我用于此目的的文件:

POPUP.JS

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup(){
    //loads popup only if it is disabled
    if(popupStatus==0){
        $("#backgroundPopup").css({
            "opacity": "0.7"
        });
        $("#backgroundPopup").fadeIn("slow");
        $("#popupContact").fadeIn("slow");
        popupStatus = 1;
    }
}

//disabling popup with jQuery magic!
function disablePopup(){
    //disables popup only if it is enabled
    if(popupStatus==1){
        $("#backgroundPopup").fadeOut("slow");
        $("#popupContact").fadeOut("slow");
        popupStatus = 0;
    }
}

//centering popup
function centerPopup(){
    //request data for centering
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var popupHeight = $("#popupContact").height();
    var popupWidth = $("#popupContact").width();
    //centering
    $("#popupContact").css({
        "position": "absolute",
        "top": windowHeight/2-popupHeight/2,
        "left": windowWidth/2-popupWidth/2
    });
    //only need force for IE6

    $("#backgroundPopup").css({
        "height": windowHeight
    });

}


//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){

    //LOADING POPUP
    //Click the button event!
    $("#button").click(function(){
        //centering with css
        centerPopup();
        //load popup
        loadPopup();
    });

    //CLOSING POPUP
    //Click the x event!
    $("#popupContactClose").click(function(){
        disablePopup();
    });
    //Click out event!
    $("#backgroundPopup").click(function(){
        disablePopup();
    });
    //Press Escape event!
    $(document).keypress(function(e){
        if(e.keyCode==27 && popupStatus==1){
            disablePopup();
        }
    });

});

and POPUP.CSS
#backgroundPopup{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
height:100%;
width:100%;
top:0;
left:0;
background:#000000;
border:1px solid #cecece;
z-index:1;
}
#popupContact{
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
height:384px;
width:750px;
background:#FFFFFF;
border:2px solid #cecece;
z-index:2;
padding:12px;
font-size:13px;
overflow:scroll;
}
#popupContact h1{
text-align:left;
color:#333;
font-size:20px;
border-bottom:1px dotted #D3D3D3;
padding-bottom:5px;
margin-bottom:20px;
}
#popupContactClose{
font-size:14px;
line-height:14px;
right:6px;
top:4px;
position:absolute;
color:#6fa5fd;
font-weight:700;
display:block;
cursor:pointer;
}
#button{
text-align:center;
}

and the html : 

<div id="popupContact">
    <a id="popupContactClose"><img src="images/x.png" alt="X" /></a>
    <h1>Reports</h1>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th class="header">Sl. No</th>
                <th class="header">Checkbox</th>
                <th class="header">Size</th>
                <th class="header">Display</th>
            </tr>
        </thead>
        <tbody> 
            <tr>
                <td>1</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr class="odd">
                <td>2</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr>
                <td>3</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr class="odd">
                <td>4</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr>
                <td>5</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr class="odd">
                <td>6</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr>
                <td>7</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr class="odd">
                <td>8</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr>
                <td>9</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr class="odd">
                <td>10</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr>
                <td>11</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
            <tr class="odd">
                <td>12</td>
                <td><input type="checkbox" name="check" id="check" /></td>
                <td><input type="text" value="" /></td>
                <td><input type="text" value="" /></td>
            </tr>
        </tbody>
    </table>        
</div>
<div id="backgroundPopup"></div>

POPUP.JS
//设置弹出窗口
//0表示残疾;1表示启用;
var popupStatus=0;
//用jquerymagic加载弹出窗口!
函数loadPopup(){
//仅在禁用时加载弹出窗口
if(popupStatus==0){
$(“#backgroundPopup”).css({
“不透明度”:“0.7”
});
$(“#背景弹出”).fadeIn(“慢”);
$(“#popupContact”).fadeIn(“慢”);
爆米花=1;
}
}
//使用jQuery魔术禁用弹出窗口!
函数disablePopup(){
//仅在启用时禁用弹出窗口
if(popupStatus==1){
$(“#背景弹出”).fadeOut(“慢”);
$(“popupContact”).fadeOut(“慢速”);
popupStatus=0;
}
}
//定心弹出窗口
函数centerPopup(){
//请求定心数据
var windowWidth=document.documentElement.clientWidth;
var windowHeight=document.documentElement.clientHeight;
var popupLight=$(“#popupContact”).height();
var popupWidth=$(“#popupContact”).width();
//定心
$(“#popupContact”).css({
“位置”:“绝对”,
“顶部”:窗高/2-PopLight/2,
“左”:窗宽/2-popupWidth/2
});
//IE6只需要武力
$(“#backgroundPopup”).css({
“高度”:窗高
});
}
//在jQuery中控制事件
$(文档).ready(函数(){
//加载弹出窗口
//点击按钮事件!
$(“#按钮”)。单击(函数(){
//以css为中心
centerPopup();
//加载弹出窗口
loadPopup();
});
//关闭弹出窗口
//点击x事件!
$(“#popupContactClose”)。单击(函数(){
禁用弹出窗口();
});
//点击退出活动!
$(“#backgroundPopup”)。单击(函数(){
禁用弹出窗口();
});
//按退出事件!
$(文档)。按键(功能(e){
if(e.keyCode==27&&popupStatus==1){
禁用弹出窗口();
}
});
});
和POPUP.CSS
#背景弹出窗口{
显示:无;
位置:固定;
_职位:绝对;/*针对internet explorer 6的黑客攻击*/
身高:100%;
宽度:100%;
排名:0;
左:0;
背景:#000000;
边框:1px实心#cecece;
z指数:1;
}
#弹出式触点{
显示:无;
位置:固定;
_职位:绝对;/*针对internet explorer 6的黑客攻击*/
高度:384px;
宽度:750px;
背景:#FFFFFF;
边框:2个实心#cecece;
z指数:2;
填充:12px;
字体大小:13px;
溢出:滚动;
}
#弹出式触点h1{
文本对齐:左对齐;
颜色:#333;
字体大小:20px;
边框底部:1px点#d3;
垫底:5px;
边缘底部:20px;
}
#popupContactClose{
字体大小:14px;
线高:14px;
右:6px;
顶部:4px;
位置:绝对位置;
颜色:#6fa5fd;
字号:700;
显示:块;
光标:指针;
}
#钮扣{
文本对齐:居中;
}
以及html:
报告
序号
复选框
大小
展示
1.
2.
3.
4.
5.
6.
7.
8.
9
10
11
12

请帮助我如何进行。

我认为在框架集(即框架集)中没有一个很好的方法来实现这一点。窗口不能将自己的元素放置在其他窗口的顶部1

实现这一点的一种黑客方法是让
框架集
中的所有
框架
知道您想要模态行为,并让它们每个都显示一个块元素(就像您在主框架中所做的那样)。这可能会发生在您的
loadPopup()
方法中

一个常规的弹出窗口可能是一个更干净的选择

但实际上,没有充分的理由使用框架集,特别是对于图中的布局


1-作为一个历史琐事,IE曾经允许一种特殊类型的元素覆盖,可以覆盖其他窗口/框架。当黑客利用它生成一个元素,用一个假URL覆盖浏览器的地址栏时,这被证明是一个特别糟糕的主意。

从图像上看,弹出窗口似乎居中于您的中间框架。。所以实际上你没有得到主窗口的高度和宽度来定位弹出窗口。还有您应用的不透明度。。那个div没有覆盖整个窗户。。我想它仅限于您当前的框架。

hi@ZippyV谢谢您的评论,如果是这种情况,您应该使用普通的HTML设计吗?我在哪里可以得到帮助来设计同样的东西?如果你看到左边的菜单,如果我点击它就会进入,如果我再次点击它就会展开,我想要同样的东西,怎么做?