Html弹出窗口我试图在提交特定窗体时向客户显示一个花哨的html弹出框/框架(不是windows样式)。不知道什么是最好的做法!Html弹出窗体提交
我尝试了下面的代码,但有2个问题。首先,弹出框看起来像一个我不想要的Windows弹出框(浏览器类型)。我只想要一个简单的方框,我可以添加颜色,图像等。另一个问题是,我的代码中的链接不起作用。例如。我想让其中一个链接在关闭消息框后将我带到网站上的另一个页面,而另一个链接可以简单地用于关闭该框......或者可能只是2个链接,可以将我带到2个不同的页面!
<form action="do.something" method="post" onsubmit="return action_submitted();">
<script type="text/javascript">
function action_submitted() {
HTML = '';
HTML += '<html><head><title>New Action</title></head>';
HTML += '<body bgcolor="#f5f5f5" style="margin:0px;">';
HTML += 'Congrats, your action was successful! <br/>';
HTML += '<a href="close">Close Message</a><br/>';
HTML += '<a href="/gothere.do">There</a><br/>';
HTML += '<script>onload=function(){setTimeout("self.close()",5000);}<'+'/script>';
HTML += '</body></html>';
var w = 500;
var h = 200;
var l = (screen.availWidth - w)/2;
var t = (screen.availHeight - h)/2;
actionwin = open('javascript:opener.HTML','actionwin','left='+l+',top='+t+',width='+w+',height='+h+',status=0');
if (actionwin && !actionwin.closed) actionwin.focus();
return true;
}
</script>
请帮助:)
非常感谢!
这样的弹出式窗口通常称为模式对话框或类似窗口。您可以在Google中找到很多插件。我在http://www.ericmmartin.com/projects/simplemodal/之前使用过这个 – elclanrs 2012-04-19 06:15:38