展开

html怎么点击一个按钮弹出一个提示框

发布于 2020-10-18 13:20:37     浏览 269

html怎么点击一个按钮弹出一个提示框

问题解析:

【】

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。垍

相关推荐

猜你可能喜欢

点击加载更多