Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.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弹出窗口_Javascript_Html - Fatal编程技术网

Javascript弹出窗口

Javascript弹出窗口,javascript,html,Javascript,Html,我从“www.hotscripts.com”复制了这段代码。 它所做的只是在屏幕中间显示一个简单的窗口。 需要3个非常简单的步骤: 1) 创建一个按钮 2) 将其包含在head中 3) 这也增加了头部: my_box = new jscPopupBox(); my_box.width = 400; my_box.height = 450; content_html = "<div style=\"padding:0;height:30px;margin:0;border:none;";

我从“www.hotscripts.com”复制了这段代码。 它所做的只是在屏幕中间显示一个简单的窗口。 需要3个非常简单的步骤:

1) 创建一个按钮

2) 将其包含在head中

3) 这也增加了头部:

my_box = new jscPopupBox();
my_box.width = 400;
my_box.height = 450;

content_html = "<div style=\"padding:0;height:30px;margin:0;border:none;";
content_html+= "background-color:#CCF;clear:both;\"><input type=\"button\" ";
content_html+= "style=\"float:right;height:26px;width:26px;\" value=\"X\" ";
content_html+= "onclick='my_box.Hide();'></div>\n";

content_html+= "<iframe src=\"../license.txt\" width=\"100%\" style=\"";
content_html+= "border:none;padding:0;margin:0;\" height=\"420px\"></iframe>";

my_box.html = content_html;
my_box=new jscPopupBox();
my_box.width=400;
我的盒子高度=450;
content\u html=“\n”;
content_html+=“”;
my_box.html=内容\u html;

我不明白为什么我的网站上的窗口出现在左上角,而不是在中间。我还没有接触到源代码,当我在一个普通的HTML页面上尝试它时,它似乎可以工作。我的CSS干扰了吗

您可能希望改用。

可能的话。你能链接到一个它不起作用的例子吗?