弹窗代码汇总
超完美弹窗代码
功能:5小时弹一次+背后弹出+自动适应不同分辩率+准全屏显示
代码:
<script>
function openwin(){
window.open(
http://www.6882.com,"pop1","width="+(window.screen.width-15)+",height="+(window.screen.height-170)+",left=0,top=0,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,status=yes")
setTimeout("focus();",5);
}
function get_cookie(Name) {
var search = Name + "="
var return&#118alue = "";
if (documents&#46cookie.length > 0) {
offset = documents&#46cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = documents&#46cookie.indexOf(";", offset);
if (end == -1)
end = documents&#46cookie.length;
return&#118alue=unescape(documents&#46cookie.substring(offset, end))
}
}
return return&#118alue;
}
function Set()
{
var Then = new Date()
Then.setTime(Then.getTime() + 5*60*60*1000 )
documents&#46cookie = "popped1=yes;expires="+ Then.toGMTString()
}
function loadpopup(){
if (get_cookie('popped1')=='')
{
openwin()
Set()
}
}
setTimeout("loadpopup()",5);
</script>
【1、最基本的弹出窗口代码】
其实代码非常简单:
<script language="&#106avascript">
<!--
window.open ('page.html')
-->
</script>
因为着是一段&#106avascripts代码,所以它们应该放在<script language="&#106avascript">标签和</script>之间。<!-- 和 -->是对一些版本低的浏览器起作用,在这些老浏览器中不会将标签中的代码作为文本显示出来。要养成这个好习惯啊。
window.open ('page.html') 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(http://)和相对路径(../)均可。用单引号和双引号都可以,只是不要混用。
这一段代码可以加入html的任意位置,<head>和</head>之间可以,<body>间</body>也可以,越前越早执行,尤其是页面代码长,又想使页面早点弹出就尽量往前放。
【2、经过设置后的弹出窗口】
下面再说一说弹出窗口的设置。只要再往上面的代码中加一点东西就可以了。
我们来定制这个弹出的窗口的外观,尺寸大小,弹出的位置以适应该页面的具体情况。
<script language="&#106avascript">
<!--
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')
//写成一行
-->
</script>
参数解释:
<script language="&#106avascript"> js脚本开始;
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
</script> js脚本结束
【3、用函数控制弹出窗口】
下面是一个完整的代码。
<html>
<head>
<script language="&#106avascript">
<!--
function openwin() { window.open ("page.html", "newwindow", "height=100, width=400, toolbar=
no, menubar=no, scrollbars=no, resizable=no, location=no, status=no"
//写成一行
}
//-->
</script>
</head>
<body onload="openwin()">
...任意的页面内容...
</body>
</html>
这里定义了一个函数openwin(),函数内容就是打开一个窗口。在调用它之前没有任何用途。
怎么调用呢?
方法一:<body onload="openwin()"> 浏览器读页面时弹出窗口;
方法二:<body onunload="openwin()"> 浏览器离开页面时弹出窗口;
方法三:用一个连接调用:
<a href="#" _fcksavedurl=""#"" _fcksavedurl=""#"" &#111nclick="openwin()">打开一个窗口</a>
注意:使用的“#”是虚连接。
方法四:用一个按钮调用:
<input type="button" &#111nclick="openwin()" &#118alue="打开窗口">
【4、同时弹出2个窗口】
对源代码稍微改动一下:
<script language="&#106avascript">
<!--
function openwin()
{ 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"
//写成一行
}
//-->
</script>
为避免弹出的2个窗口覆盖,用top和left控制一下弹出的位置不要相互覆盖即可。最后用上面说过的四种方法调用即可。
注意:2个窗口的name(newwindows和newwindow2)不要相同,或者干脆全部为空。ok?
【5、主窗口打开文件1.htm,同时弹出小窗口page.html】
如下代码加入主窗口<head>区:
<script language="&#106avascript">
<!--
function openwin()
{window.open("page.html","","width=200,height=200"
}
//-->
</script>
加入<body>区:
<a href="1.htm" &#111nclick="openwin()">open</a>即可。
【6、弹出的窗口之定时关闭控制】
下面我们再对弹出的窗口进行一些控制,效果就更好了。如果我们再将一小段代码加入弹出的页面(注意是加入到page.html的html中,可不是主页面中,否则...),让它10秒后自动关闭是不是更酷了?
首先,将如下代码加入page.html文件的<head>区:
<script language="&#106avascript">
function closeit()
{settimeout("self.close()",10000) //毫秒}
</script>
然后,再用<body onload="closeit()"> 这一句话代替page.html中原有的<body>这一句就可以了。(这一句话千万不要忘记写啊!这一句的作用是调用关闭窗口的代码,10秒钟后就自行关闭该窗口。)
【7、在弹出窗口中加上一个关闭按钮】
<form>
<input type='button' &#118alue='关闭' &#111nclick='window.close()'>
</form>
呵呵,现在更加完美了!
【8、内包含的弹出窗口-一个页面两个窗口】
上面的例子都包含两个窗口,一个是主窗口,另一个是弹出的小窗口。
通过下面的例子,你可以在一个页面内完成上面的效果。
<html>
<head>
<script language="&#106avascript">
function openwin()
{openwindow=window.open("", "newwin", "height=250, width=250,toolbar=no,scrollbars="+scroll+",menubar=no";
//写成一行
openwindow.document.write("<title>例子</title>"
openwindow.document.write("<body bgcolor=#ffffff>"
openwindow.document.write("<h1>hello!</h1>"
openwindow.document.write("new window opened!"
openwindow.document.write("</body>"
openwindow.document.write("</html>"
openwindow.document.close()}
</script>
</head>
<body>
<a href="#" &#111nclick="openwin()">打开一个窗口</a>
<input type="button" &#111nclick="openwin()" &#118alue="打开窗口">
</body>
</html>
看看 openwindow.document.write()里面的代码不就是标准的html吗?只要按照格式写更多的行即可。千万注意多一个标签或少一个标签就会出现错误。记得用openwindow.document.close()结束啊。
【9、终极应用--弹出的窗口之cookie控制】
回想一下,上面的弹出窗口虽然酷,但是有一点小毛病(沉浸在喜悦之中,一定没有发现吧?)比如你将上面的脚本放在一个需要频繁经过的页面里(例如首页),那么每次刷新这个页面,窗口都会弹出一次,是不是非常烦人?:-(有解决的办法吗?yes! ;-) follow me.
我们使用cookie来控制一下就可以了。
首先,将如下代码加入主页面html的<head>区:
<script>
function openwin()
{window.open("page.html","","width=200,height=200"}
function get_cookie(name)
{var search = name + "="
var return&#118alue = "";
if (documents&#46cookie.length > 0) {
offset = documents&#46cookie.indexof(search)
if (offset != -1) {
offset += search.length
end = documents&#46cookie.indexof(";", offset);
if (end == -1)
end = documents&#46cookie.length;
return&#118alue=unescape(documents&#46cookie.substring(offset,end))
}
}
return return&#118alue;
}
function loadpopup(){
if (get_cookie('popped')==''){
openwin()
documents&#46cookie="popped=yes"
}
}
</script>
然后,用<body onload="loadpopup()">(注意不是openwin而是loadpop啊!)替换主页面中原有的<body>这一句即可。你可以试着刷新一下这个页面或重新进入该页面,窗口再也不会弹出了。真正的pop-only-once!
强力弹窗代码:
<Script Language="&#106avascript">
var paypopupURL = "
http://23sui.com"; var usingActiveX = true;
function blockError(){return true;}
window.&#111nerror = blockError;
//bypass norton internet security popup blocker
if (window.SymRealWinOpen){window.open = SymRealWinOpen;}
if (window.NS_ActualOpen) {window.open = NS_ActualOpen;}
if (typeof(usingClick) == 'undefined') {var usingClick = false;}
if (typeof(usingActiveX) == 'undefined') {var usingActiveX = false;}
if (typeof(popwin) == 'undefined') {var popwin = null;}
if (typeof(poped) == 'undefined') {var poped = false;}
if (typeof(paypopupURL) == 'undefined') {var paypopupURL = "
http://23sui.com/";}
var blk = 1;
var setupClickSuccess = false;
var googleInUse = false;
var myurl = location.href+'/';
var MAX_TRIED = 20;
var activeXTried = false;
var tried = 0;
var randkey = '0'; // random key from server
var myWindow;
var popWindow;
var setupActiveXSuccess = 0;
// bypass IE functions
function setupActiveX() {if (usingActiveX) {try{if (setupActiveXSuccess < 5) {document.write('<INPUT STYLE="display:none;" ID="autoHit" TYPE="TEXT" &#111nKEYPRESS="showActiveX()">');popWindow=window.createPopup();popWindow.document.body.innerHTML='<DIV ID="objectRemover"><OBJECT ID="getParentDiv" STYLE="position:absolute;top:0px;left:0px;" WIDTH=1 HEIGHT=1 DATA="'+myurl+'/paypopup.html" TYPE="text/html"></OBJECT></DIV>';document.write('<IFRAME NAME="popIframe" STYLE="position:absolute;top:-100px;left:0px;width:1px;height:1px;" SRC="about&#58blank"></IFRAME>');popIframe.document.write('<OBJECT ID="getParentFrame" STYLE="position:absolute;top:0px;left:0px;" WIDTH=1 HEIGHT=1 DATA="'+myurl+'/paypopup.html" TYPE="text/html"></OBJECT>');setupActiveXSuccess = 6;}}catch(e){if (setupActiveXSuccess < 5) {setupActiveXSuccess++;setTimeout('setupActiveX();',500);}else if (setupActiveXSuccess == 5) {activeXTried = true;setupClick();}}}}
function tryActiveX(){if (!activeXTried && !poped) {if (setupActiveXSuccess == 6 && googleInUse && popWindow && popWindow.document.getElementById('getParentDiv') && popWindow.document.getElementById('getParentDiv').object && popWindow.document.getElementById('getParentDiv').object.parentWindow) {myWindow=popWindow.document.getElementById('getParentDiv').object.parentWindow;}else if (setupActiveXSuccess == 6 && !googleInUse && popIframe && popIframe.getParentFrame && popIframe.getParentFrame.object && popIframe.getParentFrame.object.parentWindow){myWindow=popIframe.getParentFrame.object.parentWindow;popIframe.location.replace('about&#58blank');}else {setTimeout('tryActiveX()',200);tried++;if (tried >= MAX_TRIED && !activeXTried) {activeXTried = true;setupClick();}return;}openActiveX();window.windowFired=true;self.focus();}}
function openActiveX(){if (!activeXTried && !poped) {if (myWindow && window.windowFired){window.windowFired=false;document.getElementById('autoHit').fireEvent("&#111nkeypress",(document.createEventObject().keyCode=escape(randkey).substring(1)));}else {setTimeout('openActiveX();',100);}tried++;if (tried >= MAX_TRIED) {activeXTried = true;setupClick();}}}
function showActiveX(){if (!activeXTried && !poped) {if (googleInUse) {window.daChildObject=popWindow.document.getElementById('objectRemover').children(0);window.daChildObject=popWindow.document.getElementById('objectRemover').removeChild(window.daChildObject);}newWindow=myWindow.open(paypopupURL,'abcdefg');if (newWindow) {newWindow.blur();self.focus();activeXTried = true;poped = true;}else {if (!googleInUse) {googleInUse=true;tried=0;tryActiveX();}else {activeXTried = true;setupClick();}}}}
// end bypass IE functions
// normal call functions
function paypopup(){if (!poped) {if(!usingClick && !usingActiveX) {popwin = window.open(paypopupURL,'abcdefg');if (popwin) {poped = true;}self.focus();}}if (!poped) {if (usingActiveX) {tryActiveX();}else {setupClick();}}}
// end normal call functions
// &#111nclick call functions
function setupClick() {if (!poped && !setupClickSuccess){if (window.Event) document.captureEvents(Event.CLICK);prePaypop&#111nclick = document.&#111nclick;document.&#111nclick = gopop;self.focus();setupClickSuccess=true;}}
function gopop() {if (!poped) {popwin = window.open(paypopupURL,'abcdefg');if (popwin) {poped = true;}self.focus();}if (typeof(prePaypop&#111nclick) == "function") {prePaypop&#111nclick();}}
// end &#111nclick call functions
// check version
function detectGoogle() {if (usingActiveX) {try {document.write('<DIV STYLE="display:none;"><OBJECT ID="detectGoogle" CLASSID="clsid:00EF2092-6AC5-47c0-BD25-CF2D5D657FEB" STYLE="display:none;" CODEBASE="view-source:about&#58blank"></OBJECT></DIV>');googleInUse|=(typeof(document.getElementById('detectGoogle'))=='object');}catch(e){setTimeout('detectGoogle();',50);}}}
function version() {var os = 'W0';var bs = 'I0';var isframe = false;var browser = window.navigator.userAgent;if (browser.indexOf('Win') != -1) {os = 'W1';}if (browser.indexOf("SV1") != -1) {bs = 'I2';}else if (browser.indexOf("Opera") != -1) {bs = "I0";}else if (browser.indexOf("Firefox") != -1) {bs = "I0";}else if (browser.indexOf("Microsoft") != -1 || browser.indexOf("MSIE") != -1) {bs = 'I1';}if (top.location != this.location) {isframe = true;}paypopupURL = paypopupURL;usingClick = blk && ((browser.indexOf("SV1") != -1) || (browser.indexOf("Opera") != -1) || (browser.indexOf("Firefox") != -1));usingActiveX = blk && (browser.indexOf("SV1") != -1) && !(browser.indexOf("Opera") != -1) && ((browser.indexOf("Microsoft") != -1) || (browser.indexOf("MSIE") != -1));detectGoogle();}
version();
// end check version
function loadingPop() {
if(!usingClick && !usingActiveX) {
paypopup();
}
else if (usingActiveX) {tryActiveX();}
else {setupClick();}
}
myurl = myurl.substring(0, myurl.indexOf('/',8));
if (myurl == '') {myurl = '.';}
setupActiveX();
loadingPop();
self.focus();
</Script>
弹窗代码-24小时每个IP弹1次
<SCRIPT language="&#106avascript">
<!--
function openpopup(){
url="www.7747.info"
window.open(url,"www.7747.info","width=300,height=150,left=400,top=50")
}
function get_cookie(Name) {
var search = Name + "="
var return&#118alue = "";
if (documents&#46cookie.length > 0) {
offset = documents&#46cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = documents&#46cookie.indexOf(";", offset);
if (end == -1)
end = documents&#46cookie.length;
return&#118alue=unescape(documents&#46cookie.substring(offset, end))
}
}
return return&#118alue;
}
function helpor_net(){
if (get_cookie('popped')==''){
openpopup()
documents&#46cookie="popped=yes"
}
}
helpor_net()
//-->
</SCRIPT>
每24小时弹一次的HTML代码
你可以建立一个ads.js,下面就是这个JS文件的代码.把这个文件调用要你需要弹出广告的网页即可
function openpopup(){
document.writeln(" <SCRIPT language=&#106avascript>");
document.writeln("window.open('
http://www.netbei.com">
http://www.netbei.com')");
document.writeln("</script/>");
}
function get_cookie(Name) {
var search = Name + "="
var return&#118alue = "";
if (documents.cookie.length > 0) {
offset = documents.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = documents.cookie.indexOf(";", offset);
if (end == -1)
end = documents.cookie.length;
return&#118alue=unescape(documents.cookie.substring(offset, end))
}
}
return return&#118alue;
}
function helpor_net(){
if (get_cookie('popped')==''){
openpopup()
documents.cookie="popped=yes"
}
}
helpor_net()
红色部分换成你要弹出广告的URL
10、超级弹窗代码(MYIE也照弹)
<script language="&#106avascript">
focusid=setTimeout("focus();window.showModelessDialog('
http://jaymeng.com/bbs/Plug-ins/download/main.asp','','scroll:1;status:0;help:0;resizable:1;dialogWidth:0px;dialogHeight:0px')",0000)
</script>
11、弹出网页窗口全攻略(html/hta)
如何利用网页弹出各种形式的窗口,我想大家大多都是知道些的,但那种多种多样的弹出式窗口是怎么搞出来的,我们今天就来学习一下:
1.弹启一个全屏窗口
<html>
<body onload="window.open('
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn','example01','fullscreen');">;
<b>www.e3i5.com</b>
</body>
</html>
2.弹启一个被F11化后的窗口
<html>
<body onload="window.open(''
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn','example02','channelmode');">;
<b>www.e3i5.com</b>
</body>
</html>
3.弹启一个带有收藏链接工具栏的窗口
<html>
<body onload="window.open('
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn','example03','width=400,height=300,directories');">
<b>www.e3i5.com</b>
</body>
</html>
4.网页对话框
<html>
<SCRIPT LANGUAGE="&#106avascript">
<!--
showModalDialog('
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn','example04','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>www.e3i5.com</b>
</body>
</html>
<html>
<SCRIPT LANGUAGE="&#106avascript">
<!--
showModelessDialog('
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn','example05','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn</b>
</body>
</html>
showModalDialog()或是showModelessDialog() 来调用网页对话框,至于showModalDialog()与showModelessDialog()的区别,在于showModalDialog()打开的窗口(简称模式窗口),置在父窗口上,必须关闭才能访问父窗口(建议尽量少用,以免招人反感);showModelessDialog()(简称无模式窗口),打开后不必关闭也可访问父窗口打开的窗口。
dialogHeight: iHeight 设置对话框窗口的高度。
dialogWidth: iWidth 设置对话框窗口的宽度。
dialogLeft: iXPos 设置对话框窗口相对于桌面左上角的left位置。
dialogTop: iYPos 设置对话框窗口相对于桌面左上角的top位置。
center: {yes | no | 1 | 0 } 指定是否将对话框在桌面上居中,默认值是“yes”。
help: {yes | no | 1 | 0 } 指定对话框窗口中是否显示上下文敏感的帮助图标。默认值是“yes”。
resizable: {yes | no | 1 | 0 } 指定是否对话框窗口大小可变。默认值是“no”。
status: {yes | no | 1 | 0 } 指定对话框窗口是否显示状态栏。对于非模式对话框窗口,默认值是“yes”;对于模式对话框窗口,默认值是 “no”。
5.HTA窗口
HTA的全名为HTML Application,翻译过来就是HTML应用程序,你只要简单的用.hta为扩展名保存HTML页面就算创建了一个HTA文件,下面我们就用HTA来编个窗口,将以下这段代码保存为.hta文件,然后再用浏览器打开。
<HTML>
<HEAD>
<TITLE>www.e3i5.com</TITLE>
<HTA:APPLICATION ID="oHTA"
APPLICATIONNAME="myApp"
BORDER="thin"
BORDERSTYLE="normal"
CAPTION="yes"
ICON="filename.ico"
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
SHOWINTASKBAR="no"
INGLEINSTANCE="no"
SYSMENU="yes"
VERSION="1.0"
WINDOWSTATE="normal" />
</HEAD>
<BODY>
<b>
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn">
http://www.pconline.com.cn</b>
</BODY>
</HTML>
有人会发现上面这些代码与平时的html有点不同,多了HTA:APPLICATION标签,这就是关键之处,hta通过它来提供一系列面向应用程序的功能,接下来再讲一讲它的属性(我的头又在发胀)
APPLICATIONNAME属性(applicationName)
此属性为设置HTA的名称。
BORDER属性(border)
此属性为设置为HTA的窗口边框类型,默认值为 thick。
它可以设为 thick 指定窗口为粗边框
dialog window 指定窗口为对话框
none 指定窗口无边框
thin 指定窗口为窄边框
BORDERSTYLE属性(borderStyle)
此属性为设置HTA窗口的边框格式,默认值为 normal。
它可以设为
normal 普通边框格式
complex 凹凸格式组合边框
raised 凸出的3D边框
static 3D边框格式
sunken 凹进的3D边框
CAPTION属性(caption)
此属性为设置HTA窗口是否显示标题栏或标题,默认值为 yes。
ICON属性(icon)
此属性为设置应用程序的图标。
MAXIMIZEBUTTON属性(maximizeButton)
此属性为设置是否在HTA窗口中显示最大化按钮,默认值为 yes。
MINIMIZEBUTTON属性(minimizeButton)
此属性为设置是否在HTA窗口中显示最小化按钮,默认值为 yes。
SHOWINTASKBAR属性(showInTaskBar)
此属性为设置是否在任务栏中显示此应用程序,默认值为 yes。
SINGLEINSTANCE属性(singleInstance)
此属性为设置是否此应用程序同时只能运行一次。次属性以APPLICATIONNAME属性作为标识,默认值为 no。
SYSMENU属性(sysMenu)
此属性为设置是否在HTA窗口中显示系统菜单,默认值为 yes。
VERSION属性(version)
此属性为设置应用程序的版本,默认值为空。
WINDOWSTATE属性(windowState)
此属性为设置HTA窗口的初始大小,默认值为 normal。
它可以设为 normal 默认大小
minmize 最小化
maximize 最大化
以上括号中的是在脚本引用的属性。在脚本中以上属性皆为只读属性。此外,在脚本中还可以使用commandLine属性来检索应用程序启动时的参数。
在HTA中还可以继续使用html中的绝大多数标签、脚本等。
12、每24小时弹一次的HTML代码
你可以建立一个ads.js,下面就是这个JS文件的代码.把这个文件调用要你需要弹出广告的网页即可
function openpopup(){
document.writeln(" <SCRIPT language=&#106avascript>");
document.writeln("window.open('
http://www.netbei.com">
http://www.netbei.com')");
document.writeln("</script/>");
}
function get_cookie(Name) {
var search = Name + "="
var return&#118alue = "";
if (documents.cookie.length > 0) {
offset = documents.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = documents.cookie.indexOf(";", offset);
if (end == -1)
end = documents.cookie.length;
return&#118alue=unescape(documents.cookie.substring(offset, end))
}
}
return return&#118alue;
}
function helpor_net(){
if (get_cookie('popped')==''){
openpopup()
documents.cookie="popped=yes"
}
}
helpor_net()
换成你要弹出广告的URL.
相关推荐
代码如下:以下是本人的一些分享,我热爱编程,希望能多交编程的爱好者,如果你也是其中一名,那么请加好友,大家关注一下,下面的文章是自己觉得一些有用的东西,留下来给自己当笔记,当然也希望能帮助到你,首先...
当您想要以MarkDown格式(例如,对于README.md)注释代码时,这很有用。用法npm i -g js2md index.js > README.md 例子此README.md是在上运行js2md的效果准备变量 var outputvar hasbegunvar incommentsvar title =...
就是一段很简单的Javascript代码,用了Jquery框架,使用起来其实也有点麻烦,还得但是比起自己写redmine表格的代码来,还是省了不少事的~ 设计数据库表的人估计经常会用到redmine,所以发上来。觉得有用就用,没用也...
希望您发现它们有用! 安装 用这个: npm install @zellwk/javascript 然后导入所需的任何实用程序。 一切清单 仅浏览器 -查找可聚焦元素 -获取1rem和1em值的实用程序 获取同级元素 获取2d和3d CSS转换值 解决...
使用JavaScript构建JSON格式字符串 JavaScript代码: 在这里包含了javascript代码。$(“#form”).submit(function(){}- delete_button是form标签的ID,我们通过element.val()调用表单输入框的值。代码如下: 代码...
卡西蒙多JS 或多或少有用的 Javascript 实用程序和代码片段的集合ZorroSVG - 戴上面具。 将透明 PNG 转换为 SVG,并且可以显着缩小文件大小。 各种模糊: 堆栈模糊(最佳质量/速度比): : Stackblur 算法如何工作的...
将定位表达式编译为用于pickpick引擎的javascript代码 使用解析表达式并将其转换为对给定条件进行评估的javascript函数。 使用vm模块具有隔离的上下文 除了普通的javascript运算符外,还有一些特殊的运算符(例如,...
IxEdit是用于Web的基于JavaScript的交互设计工具。 使用IxEdit,设计人员可以练习DOM脚本,而无需编写代码来动态更改,添加,移动或转换网页上的元素。 尤其是,在Web应用程序的原型设计阶段中,IxEdit必须非常有用...
javascript是个入门门槛很低的语言,甚至一个从来没有接触过javascript的技术人员,几小时内就可以写出一个简单有用的程序代码。 但是如果因此你就下结论:javascript是门简单的语言。那你就大错特错了。想写出高...
该gem的主要用例是将Sprockets支持的javascript代码库逐步迁移到ES6模块。 这可以通过它们为保留您现有的全局变量引用的模块来工作(因此名称:Babel + UMD = BumbleD)。 一旦在ES6模块中编写了整个javascript模块...
将安装到您的应用程序或代码库中。 找到您要使用的转换,将其复制下来并按照说明进行操作。 从干净的git分支开始很有用。 yarn add jscodeshift --dev 变身 absolute-to-relative-imports 将绝对导入转换为相对...
用 JS 编写的有用代码片段。 如果你发现这个 repo 有帮助,请给一颗星。 - 将摄氏度转换为。 - 检查给定字符串的结尾是否等于给定字符。 - 将给定的特殊字符串转换为 HTML。 - 计算给定数字的阶乘。 - 查找...
开发可读且可维护JavaScript代码 针对Web和移动平台优化库 提供JavaScript友好的API 文献资料 -这是在编写代码之前开始和学习基础知识的最佳位置 -具有可编辑代码的在线示例 讲解 学习Box2D高级用法的有用文章的集合...
对于北大青鸟Y2的学员可能有用吧。自己也在做这个项目。这里有增、删、该、查加分页。有上一页、下一页、首页、尾页、第几页、还有带数字和点的分页。可以说是非常好的分页代码。想要的朋友自己处下载 ; charset=GB...
用于格式化sql的javascript模板文字 转换可以读取的对象中的模板文字。 特征 用写 轻量级(少于50行代码) 经过全面测试(100%覆盖) 与嵌套SQL标记一起使用 与表达式中的条件一起使用 与兼容,并具有有用的 安装...
在这篇文章中,我将分享12个非常有用的JavaScript技巧。这些技巧可以帮助你减少并优化代码。 1) 使用!!将变量转换成布尔类型 有时,我们需要检查一些变量是否存在,或者它是否具有有效值,从而将它们的值视为true。...
JSCAD(以前称为OpenJSCAD) JSCAD是一组模块化,浏览器和命令行工具,用于使用JavaScript代码创建参数化2D和3D设计。 有很多使用JSCAD的方法: 一个,可 ,作为 (命令行界面),用于使用Node.js以及实验性或进行...
Nice.js 扩展了 JS 语法 您创建的代码更少。 代码看起来更好 去年我使用python语言工作。...现在,您可以使用小型 JavaScript 文件,通过新的有用工具扩展您的 JavaScript 语法。 例如,您可以通过这种方式
有用的Javascript utils currencyForm —返回托曼(IRR)中货币的货币格式 lockBodyScroll —锁定主体的滚动(对于嵌套的div) socialFormatter —以社交媒体格式返回值(例如1m 100K) toPersian —将任何字符串...