编辑:改变标题实际上是正确的
我正在尝试在所有HTML和CSS中模拟一个模态弹出窗口,并且我正在运行我正在做的一个单一元素.我希望最里面的div,即内容的div,不像边框那样不透明,但无论我尝试使用CSS,我都无法让它工作.这是代码:
CSS
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<table style="height: 100%; width: 100%; position: fixed; top: 0; left: 0;"><tr><td class="modalBackground">
<div style="display: table; height: 40px; width: 150px; position: fixed; overflow: hidden;
top: 40%; margin-top: -50px; left: 50%; margin-left: -75px; padding-left: 30px;
border: solid 1px navy; background-color: White;">
<div style="#position: absolute; #top: 50%; display: table-cell; vertical-align: middle;">
<div style="#position: relative; #top: -50%;"
><asp:Image runat="server" ImageUrl= "~/images/indicators/indicatordark.gif" /> working...</div>
</div>
</div></td></tr></table>
Run Code Online (Sandbox Code Playgroud)
我在这方面达到了目的.无论如何我都不是HTML或CSS大师,因此非常感谢解释为什么解决方案有效.
我正在尝试解决我在ASP.Net应用程序中使用jQuery的对话框时遇到的问题.
我有两个对话框,页面tos_text和tos_thankyou它们当然简单的<div>操作内容显示标签.
首先,我使用Google CDN来引用jQuery:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是,当我尝试附加jQuery对话框方法时,浏览器声称该对象上不存在对话框方法.由于我使用ASP.Net,我在运行时有条件地在Page_PreRender事件处理程序中注入javascript :
protected void Page_PreRender(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, GetType(), "RegisterThankYouDialog",
"\n<script type='text/javascript'>$(function() { $('#tos_thankyou').dialog({ autoOpen: false, modal: true, buttons: { Ok : function() { $(this).dialog('close'); } } }); });</script>\n", false);
ScriptManager.RegisterStartupScript(this, GetType(), "RegisterTOSDialog",
"\n<script type='text/javascript'>$(function() { $('#tos_text').dialog({ autoOpen: false, modal: true, }); });</script>\n", false);
if (Show || ForceShow)
{
ScriptManager.RegisterStartupScript(this, GetType(), "ShowTOSDialog",
"\n<script type='text/javascript'>$(function() { $('#tos_text').dialog('open'); });</script>\n", false);
}
if (ShowThankYou)
{
ScriptManager.RegisterStartupScript(this, …Run Code Online (Sandbox Code Playgroud)