推荐:
美食
旅游
音乐
摄影
影视
数码
游戏
地理
政务
汽车
看书
人物
体育
购物
更多
站点栏目:
首页
科技
生活
职业
教育
资讯
关于
会员:
首页
科技
生活
职业
教育
资讯
关于
美食
旅游
音乐
摄影
影视
数码
游戏
地理
政务
汽车
看书
人物
体育
购物
更多
培训
学习
情感
房产
金融
工作
农业
命理
动物
健康
历史
其他
展开
html怎么点击一个按钮弹出一个提示框
发布于 2020-10-18 13:20:37 浏览
269
次
前述
详情
问题解析:
【】
1、
html做点一个按钮就弹出文字的代码:
2、
1.最基本的弹出窗口代码
3、
<SCRIPTLANGUAGE="javascript">垍
4、
<!window.open('page.html')></SCRIPT>垍
5、
2.经过设置后的弹出窗口
6、
<SCRIPTLANGUAGE="javascript">垍
7、
<!window.open('page.html','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')//>
8、
</SCRIPT>
9、
3.用函数控制弹出窗口
10、
<html>
11、
<head>
12、
<scriptLANGUAGE="JavaScript">垍
13、
<!functionopenwin(){window.open("page.html","newwindow","height=100,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no")//}//>垍
14、
</script>垍
15、
</head>垍
16、
<bodyonload="openwin()">
17、
</body>
18、
</html>
19、
4.同时弹出2个窗口
20、
<scriptLANGUAGE="JavaScript">
21、
<!functionopenwin(){window.open("page.html","newwindow","height=100,width=100,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no")//window.open("page2.html","newwindow2","height=100,width=100,top=100,left=100,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no")//}//>垍
22、
</script>
23、
5.主窗口打开文件1.htm,同时弹出小窗口page.html
24、
如下代码加入主窗口<head>区:
25、
<scriptlanguage="javascript">
26、
<!functionopenwin(){window.open("page.html","","width=200,height=200")}//>垍
27、
</script>
28、
加入<body>区:<ahref="1.htm"onclick="openwin()">open</a>
29、
6.弹出的窗口之定时关闭控制
30、
首先,将如下代码加入page.html文件的<head>区:
31、
<scriptlanguage="JavaScript">
32、
functioncloseit()
33、
{setTimeout("self.close()",10000)//毫秒}
34、
</script>
35、
7.在弹出窗口中加上一个关闭按钮垍
36、
<FORM>
37、
<INPUTTYPE='BUTTON'VALUE='关闭'onClick='window.close()'>
38、
</FORM>
39、
8.内包含的弹出窗口-一个页面两个窗口
40、
<html>垍
41、
<head>
42、
<SCRIPTLANGUAGE="JavaScript">
43、
functionopenwin()垍
44、
{OpenWindow=window.open("","newwin","height=250,width=250,toolbar=no,scrollbars="+scroll+",menubar=no");
45、
//OpenWindow.document.write("<TITLE>例子</TITLE>")
46、
OpenWindow.document.write("<BODYBGCOLOR=#ffffff>")
47、
OpenWindow.document.write("<h1>Hello!</h1>")
48、
OpenWindow.document.write("Newwindowopened!")垍
49、
OpenWindow.document.write("</BODY>")
50、
OpenWindow.document.write("</HTML>")垍
51、
OpenWindow.document.close()}
52、
</SCRIPT>
53、
</head>
54、
<body>
55、
<ahref="#"onclick="openwin()">打开一个窗口</a>
56、
<inputtype="button"onclick="openwin()"value="打开窗口">垍
57、
</body>
58、
</html>
59、
9.终极应用弹出的窗口之Cookie控制垍
60、
首先,将如下代码加入主页面HTML的<HEAD>区:
61、
<script>
62、
functionopenwin(){
63、
window.open("page.html","","width=200,height=200")}
64、
functionget_cookie(Name){varsearch=Name+"="varreturnvalue="";
65、
if(document.cookie.length>0){offset=document.cookie.indexOf(search)
66、
if(offset!=-1){offset+=search.lengthend=document.cookie.indexOf(";",offset);
67、
if(end==-1)
68、
end=document.cookie.length;
69、
returnvalue=unescape(document.cookie.substring(offset,end))}}垍
70、
returnreturnvalue;}
71、
functionloadpopup(){if(get_cookie('popped')==''){openwin()
72、
document.cookie="popped=yes"}}
73、
</script>?垍
74、
Asp教程-ASP应用
75、
this.Response.Write(<Script>window.open('WebForm7.aspx','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=470,left=80,top=40');</script>");
76、
弹出跟你当前的窗口有没有菜单工具栏没有关系,你只要在页面中写一个脚本它就弹出了.比如
77、
<ahref=#onclick="window.open('xxx.aspx','窗口名称','参数');">xxxxx</a>
78、
以下列出一些弹出窗口的参数:
79、
(如:"fullscreen=yes,toolbar=yes")。下面是被支持的各种特性。
80、
channelmode={yes|no|1|0}是否在窗口中显示阶梯模式。默认为no。
81、
directories={yes|no|1|0}是否在窗口中显示各种按钮。默认为yes。
82、
fullscreen={yes|no|1|0}是否用全屏方式显示浏览器。默认为no。
83、
height=number指定窗口的高度,单位是像素。最小值是100。
84、
left=number指定窗口距左边框的距离,单位是像素。值必须大于或者等于0。垍
85、
location={yes|no|1|0}指定是否在窗口中显示地址栏。默认为yes。
86、
menubar={yes|no|1|0}指定是否在窗口中显示菜单栏。默认为yes。
87、
resizable={yes|no|1|0}指定是否在窗口中显示可供用户调整大小的句柄。默认为yes。垍
88、
scrollbars={yes|no|1|0}指定是否在窗口中显示横向或者纵向滚动条。默认为yes。
89、
status={yes|no|1|0}指定是否在窗口中显示状态栏。默认为yes。
90、
titlebar={yes|no|1|0}指定是否在窗口中显示标题栏。在非调用HTMLApplication或者一个对话框的情况下,这一项将被忽略。默认为yes。垍
91、
toolbar={yes|no|1|0}指定是否在窗口中显示工具栏,包括如前进、后退、停止等按钮。默认为yes。
92、
top=number指定窗口顶部的位置,单位是像素。值必须大于或者等于0。垍
93、
width=number指定窗口的宽度,单位是像素。最小值是100。垍
相关推荐
开机后电脑滴滴响怎么回事
发布于2022-07-23 03:02:37 3357个赞
百度网盘怎么下载磁力链接
发布于2022-07-19 08:52:48 983个赞
涨乐财富通怎么查询买卖手续费和印花税
发布于2022-07-14 04:22:52 1202个赞
办了营业执照但是没办税务登记怎么办
发布于2022-07-14 04:19:15 792个赞
小规模纳税人没有进项发票怎么办
发布于2022-07-14 04:15:51 655个赞
该文件夹为空怎么办
发布于2022-07-02 21:16:27 555个赞
淘宝店铺页尾怎么设计
发布于2022-06-16 01:44:11 444个赞
苹果11pro怎么看是不是国行
发布于2022-06-16 00:50:05 419个赞
系统已禁止安装怎么办
发布于2022-06-15 22:45:34 754个赞
苹果11底部横线怎么关闭
发布于2022-06-15 20:35:37 409个赞
猜你可能喜欢
u型管作用有哪些
发布于2024-07-16 10:08:31 123个赞
uv胶是什么_怎么使用_怎么去除_怎么固化_用途
发布于2024-07-16 10:07:34 181个赞
鬼杀队人物实力排名
发布于2024-07-16 10:06:28 156个赞
为什么不明白我所有的爱是什么歌
发布于2024-07-16 10:05:11 206个赞
狂飙专属bgm是什么歌
发布于2024-07-16 10:04:39 161个赞
vip歌曲下载到u盘能永久吗
发布于2024-07-16 10:03:43 228个赞
夏花电视剧插曲是哪几首
发布于2024-07-16 10:02:39 179个赞
谁是谁生命的过客是什么歌
发布于2024-07-16 10:02:10 199个赞
张杰演唱会门票在哪个app买
发布于2024-07-16 10:01:45 180个赞
抖音很火的一首歌开头是耶
发布于2024-07-16 10:00:52 169个赞
点击加载更多