Javascript CSS代表;弹出窗口“;不在FireFox中工作
我在网上找到了一些使用div和CSS不透明属性在CSS中实现“弹出”表单的代码。它在IE和Chrome中工作得很好,但在FireFox中却不行。在FireFox中,什么都不会发生。我在主板上看到了一些FireFox CSS的问题,但没有具体的问题。在这个问题上的任何帮助都将是巨大的,因为我对CSS非常陌生。谢谢 [Here][1]是我获取代码供参考的网站 CSS HTML:Javascript CSS代表;弹出窗口“;不在FireFox中工作,javascript,asp.net,css,Javascript,Asp.net,Css,我在网上找到了一些使用div和CSS不透明属性在CSS中实现“弹出”表单的代码。它在IE和Chrome中工作得很好,但在FireFox中却不行。在FireFox中,什么都不会发生。我在主板上看到了一些FireFox CSS的问题,但没有具体的问题。在这个问题上的任何帮助都将是巨大的,因为我对CSS非常陌生。谢谢 [Here][1]是我获取代码供参考的网站 CSS HTML: 看起来我的脚本类型标记是jscript,这是我的愚蠢错误。谢谢大家的帮助 您是否检查了Javascript错误控制台或Fi
看起来我的脚本类型标记是jscript,这是我的愚蠢错误。谢谢大家的帮助 您是否检查了Javascript错误控制台或Firebug中是否报告了错误?我在firefox 3.6.13中测试并运行,但在Chrome11b或FF4b11中不运行:
弹出窗口未定义
在FF 3.0.8中对我很好firefox缺少innerText,outerHTML属性和FF中的兄弟节点/子节点可以是空文本节点。我没有看到这些属性被使用,所以是的,您需要在firebug中或者至少在内置的错误控制台(Ctrl+Shift+J)中查找错误。
#blanket
{
background-color: #111;
opacity: 0.65;
filter: alpha(opacity=65);
position: absolute;
z-index: 9001;
top: 0px;
left: 0px;
width: 100%;
}
#popUpDiv
{
position: absolute;
background-color: #eeeeee;
width: 300px;
height: 300px;
z-index: 9002;
}
<td align="left">
<div id="blanket" style="display: none;">
</div>
<div id="popUpDiv" style="display: none;">
<table>
<tr>
<td>
<a href="#" onclick="popup('popUpDiv')">Close</a>
</td>
</tr>
<tr>
<td style="color: Black;">
Please describe the issue:
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtIssue" runat="server" TextMode="MultiLine" Width="275" Height="200"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="cmdSend" runat="server" Text="Send" />
</td>
</tr>
</table>
</div>
<a href="#" onclick="popup('popUpDiv')">Click here to report an issue.</a>
<br />
<asp:Label ID="lblIssueStatus" runat="server" Text="" Style="color: Red;"></asp:Label>
</td>
function toggle(div_id) {
var el = document.getElementById(div_id);
if ( el.style.display == 'none' ) { el.style.display = 'block';}
else {el.style.display = 'none';}
}
function blanket_size(popUpDivVar) {
if (typeof window.innerWidth != 'undefined') {
viewportheight = window.innerHeight;
} else {
viewportheight = document.documentElement.clientHeight;
}
if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
blanket_height = viewportheight;
} else {
if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
blanket_height = document.body.parentNode.clientHeight;
} else {
blanket_height = document.body.parentNode.scrollHeight;
}
}
var blanket = document.getElementById('blanket');
blanket.style.height = blanket_height + 'px';
var popUpDiv = document.getElementById(popUpDivVar);
popUpDiv_height=blanket_height/2-150;//150 is half popup's height
popUpDiv.style.top = popUpDiv_height + 'px';
}
function window_pos(popUpDivVar) {
if (typeof window.innerWidth != 'undefined') {
viewportwidth = window.innerHeight;
} else {
viewportwidth = document.documentElement.clientHeight;
}
if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
window_width = viewportwidth;
} else {
if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
window_width = document.body.parentNode.clientWidth;
} else {
window_width = document.body.parentNode.scrollWidth;
}
}
var popUpDiv = document.getElementById(popUpDivVar);
window_width=window_width/2-150;//150 is half popup's width
popUpDiv.style.left = window_width + 'px';
}
function popup(windowname) {
blanket_size(windowname);
window_pos(windowname);
toggle('blanket');
toggle(windowname);
}