Wed

04

Mar

2009

30、各种用途的按钮

30、各种用途的按钮

<html>

<head>

<title>网页特效---各种用途的按钮</title>

<style type="text/css">

<!--

body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 4px; margin-right: 0px}

A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }

 A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }

a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

--></style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body>

<br>

<br>

<center><font color=red face="隶书" size=6>各种用途的按钮</font></center>

<br>

<center>

<table border=5 bordercolor=blue borderlight=green>

<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></font></td></tr>

<tr><td align=center height=80><form>

        <p>

                <input TYPE="button" NAME="view" VALUE="查看本例的源码" OnClick="window.location="view-source:" +window.location.href" class="pt9">

      </p>

 </form>

 

 

<form>

  <p><input TYPE="button" VALUE="返回上一步" ONCLICK="history.back(-1)"></p>

</form>

 

<form>

  <p><input TYPE="button" VALUE="刷新按钮一" ONCLICK="ReloadButton()"></p>

</form>

<script language="JavaScript"><!--

function ReloadButton(){location.href="allbutton.htm";}

// --></script>

 

 

<form>

  <p><input TYPE="button" VALUE="刷新按钮二" onClick="history.go(0)"> </p>

</form>

 

<form>

  <p><input TYPE="button" VALUE="回首页按钮" ONCLICK="HomeButton()"></p>

</form>

<script language="JavaScript"><!--

function HomeButton(){location.href="http://nettrain.126.com";}

// --></script>

 

 

<form>

  <p><input TYPE="button" VALUE="弹出警告框" ONCLICK="AlertButton()"></p>

</form>

<script language="JavaScript"><!--

function AlertButton(){window.alert("要多多光临呀!");}

// --></script>

 

 

<form>

  <p><input TYPE="button" VALUE="状态栏信息" ONCLICK="StatusButton()"></p>

</form>

<script language="JavaScript"><!--

function StatusButton(){window.status="要多多光临呀!";}

// --></script>

 

 

<form>

  <p><input TYPE="button" VALUE="背景色变换" onClick="BgButton()"></p>

</form>

<script>function BgButton(){

if (document.bgColor=='#00ffff')

    {document.bgColor='#ffffff';}

else{document.bgColor='#00ffff';}

}

  </script>

 

 

<form>

  <p><input TYPE="button" VALUE="打开新窗口" ONCLICK="NewWindow()"></p>

</form>

<script language="JavaScript"><!--

function NewWindow(){window.open("5.htm","","height=240,width=340,status=no,location=no,toolbar=no,directories=no,menubar=no");}

// --></script>

</td></tr></table></center>

<br>

<br>

<center>

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- hide

function goHist(a)

{

   history.go(a);

}

//-->

</script>

</center>

<br>

<center>

 <br>

<br>

</body>

</html>

0 Comments

Wed

04

Mar

2009

29、自动滚屏按钮

29、自动滚屏按钮

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效---自动滚屏按钮</title>

</head>

 

<body>

 

 

<script Language="JavaScript">

function scrollit(){

        for (I=1; I<=500; I++){

                parent.scroll(1,I)

        }

}

</script>

<form>

<div align="center"><center><p><input type="button" value="向下滚屏" onClick="scrollit()"> </p>

</center></div>

</form>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

</body>

 

</html>

0 Comments

Wed

04

Mar

2009

28、会变色的按钮

28、会变色的按钮

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效---会变色的按钮</title>

</head>

 

<body>

 

 

<style>

  .start {color:black; background:red}

</style>

<script LANGUAGE="JAVASCRIPT">

  function highlightButton(s) {

    if ("INPUT"==event.srcElement.tagName)

      event.srcElement.className=s

  }

</script>

 

<form name="form2" onmouseover="highlightButton('start')" onmouseout="highlightButton('')">

<center><p>

<input type="button" value="按这里试试" name="B2"></p>

</form>

</body>

 

</html>

0 Comments

Wed

04

Mar

2009

27、离开转跳到指定网址

27、离开转跳到指定网址

<html>

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效代码---离开时转跳到指定网址</title>

 

</head>

 

<body onUnload="leave()">

<script LANGUAGE="JavaScript">

<!-- Begin

function leave() {

window.open('http://www.163.com','','toolbar=no,menubar=no,location=no,height=70,width=650');

}

// End -->

</script>

 

</body>

</html>

0 Comments

Wed

04

Mar

2009

26、自动关闭窗口

26、自动关闭窗口

<html>

<head>

<title>网页特效-打开一个窗口在一定的时间内自动关闭</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body onload="setTimeout('window.close()',2000)">

两秒钟关闭(2s=2000微秒)

</body>

</html>

 

0 Comments

Wed

04

Mar

2009

25、页面内超级酷浮动窗口

25、页面内超级酷浮动窗口

<html>

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效---页面内的超级酷浮动窗口</title>

<style type='text/css'>

<!--

a:visited{text-decoration:none;color:slategray;}

a:hover{text-decoration:underline;color:slategray;}

a:link{text-decoration:none;color:slategray;}

-->

</style>

<script language=JScript>

<!--

//可以打包为js文件;

var x0=0,y0=0,x1=0,y1=0;

var offx=6,offy=6;

var moveable=false;

var hover='orange',normal='slategray';//color;

var index=10000;//z-index;

//开始拖动;

function startDrag(obj)

{

       if(event.button==1)

       {

              //锁定标题栏;

              obj.setCapture();

              //定义对象;

              var win = obj.parentNode;

              var sha = win.nextSibling;

              //记录鼠标和层位置;

              x0 = event.clientX;

              y0 = event.clientY;

              x1 = parseInt(win.style.left);

              y1 = parseInt(win.style.top);

              //记录颜色;

              normal = obj.style.backgroundColor;

              //改变风格;

              obj.style.backgroundColor = hover;

              win.style.borderColor = hover;

              obj.nextSibling.style.color = hover;

              sha.style.left = x1 + offx;

              sha.style.top  = y1 + offy;

              moveable = true;

       }

}

//拖动;

function drag(obj)

{

       if(moveable)

       {

              var win = obj.parentNode;

              var sha = win.nextSibling;

              win.style.left = x1 + event.clientX - x0;

              win.style.top  = y1 + event.clientY - y0;

              sha.style.left = parseInt(win.style.left) + offx;

              sha.style.top  = parseInt(win.style.top) + offy;

       }

}

//停止拖动;

function stopDrag(obj)

{

       if(moveable)

       {

              var win = obj.parentNode;

              var sha = win.nextSibling;

              var msg = obj.nextSibling;

              win.style.borderColor     = normal;

              obj.style.backgroundColor = normal;

              msg.style.color           = normal;

              sha.style.left = obj.parentNode.style.left;

              sha.style.top  = obj.parentNode.style.top;

              obj.releaseCapture();

              moveable = false;

       }

}

//获得焦点;

function getFocus(obj)

{

       if(obj.style.zIndex!=index)

       {

              index = index + 2;

              var idx = index;

              obj.style.zIndex=idx;

              obj.nextSibling.style.zIndex=idx-1;

       }

}

//最小化;

function min(obj)

{

       var win = obj.parentNode.parentNode;

       var sha = win.nextSibling;

       var tit = obj.parentNode;

       var msg = tit.nextSibling;

       var flg = msg.style.display=="none";

       if(flg)

       {

              win.style.height  = parseInt(msg.style.height) + parseInt(tit.style.height) + 2*2;

              sha.style.height  = win.style.height;

              msg.style.display = "block";

              obj.innerHTML = "0";

       }

       else

       {

              win.style.height  = parseInt(tit.style.height) + 2*2;

              sha.style.height  = win.style.height;

              obj.innerHTML = "2";

              msg.style.display = "none";

       }

}

//关闭;

function cls(obj)

{

       var win = obj.parentNode.parentNode;

       var sha = win.nextSibling;

       win.style.visibility = "hidden";

       sha.style.visibility = "hidden";

}

//创建一个对象;

function xWin(id,w,h,l,t,tit,msg)

{

       index = index+2;

       this.id      = id;

       this.width   = w;

       this.height  = h;

       this.left    = l;

       this.top     = t;

       this.zIndex  = index;

       this.title   = tit;

       this.message = msg;

       this.obj     = null;

       this.bulid   = bulid;

       this.bulid();

}

//初始化;

function bulid()

{

       var str = ""

              + "<div id=xMsg" + this.id + " "

              + "style='"

              + "z-index:" + this.zIndex + ";"

              + "width:" + this.width + ";"

              + "height:" + this.height + ";"

              + "left:" + this.left + ";"

              + "top:" + this.top + ";"

              + "background-color:" + normal + ";"

              + "color:" + normal + ";"

              + "font-size:10px;"

              + "font-family:Verdana;"

              + "position:absolute;"

              + "cursor:default;"

              + "border:2px solid " + normal + ";"

              + "' "

              + "onmousedown='getFocus(this)'>"

                     + "<div "

                     + "style='"

                     + "background-color:" + normal + ";"

                     + "width:" + (this.width-2*2) + ";"

                     + "height:20;"

                     + "color:white;"

                     + "' "

                     + "onmousedown='startDrag(this)' "

                     + "onmouseup='stopDrag(this)' "

                     + "onmousemove='drag(this)' "

                     + "ondblclick='min(this.childNodes[1])'"

                     + ">"

                            + "<span style='width:" + (this.width-2*12-4) + ";padding-left:3px;'>" + this.title + "</span>"

                            + "<span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='min(this)'>0</span>"

                            + "<span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='cls(this)'>r</span>"

                     + "</div>"

                            + "<div style='"

                            + "width:100%;"

                            + "height:" + (this.height-20-4) + ";"

                            + "background-color:white;"

                            + "line-height:14px;"

                            + "word-break:break-all;"

                            + "padding:3px;"

                            + "'>" + this.message + "</div>"

              + "</div>"

              + "<div style='"

              + "width:" + this.width + ";"

              + "height:" + this.height + ";"

              + "top:" + this.top + ";"

              + "left:" + this.left + ";"

              + "z-index:" + (this.zIndex-1) + ";"

              + "position:absolute;"

              + "background-color:black;"

              + "filter:alpha(opacity=40);"

              + "'>by wildwind</div>";

       document.body.insertAdjacentHTML("beforeEnd",str);

}

//-->

</script>

 

<script language='JScript'>

<!--

function initialize()

{

       var a = new xWin("1",160,200,200,200,"Message","xWin <br> A Cool Pop Div Window<br>Version:1.0<br>2002-8-13");

       var b = new xWin("2",240,200,100,100,"Wildwind's Msgbox","Welcome to visited my personal website:<br><a href=http://7stk.com://www14.brinkster.com/wildcity target=_blank>http://7stk.com://wildcity.126.com</a><br>and u can also sign my guestbook at:<br><a href=http://7stk.com://www14.brinkster.com/wildcity/gbook target=_blank>http://7stk.com://wildcity.126.com/gbook</a><br><br>thx!!! =)...");

       var c = new xWin("3",200,160,250,50,"Copyright","Copyright by <a href='mailto:wildwind_zz@21cn.com'>Wildwind</a>!");

}

window.onload = initialize;

//-->

</script>

</head>

<body onselectstart='return false' oncontextmenu='return false' scroll='no'>

</body>

</html>

 

 

0 Comments

Wed

04

Mar

2009

24、一个再普通不过计算器

24、一个再普通不过计算器

要完成此效果把如下代码加入到<body>区域中

 

<script language="JavaScript">

 

<!-- Hide the script from old browsers --

 

function compute(obj)

 

   {obj.expr.value = eval(obj.expr.value)}

 

var one = '1'

 

var two = '2'

 

var three = '3'

 

var four = '4'

 

var five = '5'

 

var six = '6'

 

var seven = '7'

 

var eight = '8'

 

var nine = '9'

 

var zero = '0'

 

var plus = '+'

 

var minus = '-'

 

var multiply = '*'

 

var divide = '/'

 

var decimal = '.'

 

function enter(obj, string)

 

   {obj.expr.value += string}

 

function clear(obj)

 

   {obj.expr.value = ''}

 

// --End Hiding Here -->

 

</script>

 

<form name="calc">

 

<table border=1>

 

<td colspan=4><input type="text" name="expr" size=30 action="compute(this.form)"> <tr>

 

<td><input type="button" value="  7  " onClick="enter(this.form, seven)">

 

<td><input type="button" value="  8  " onClick="enter(this.form, eight)">

 

<td><input type="button" value="  9  " onClick="enter(this.form, nine)">

 

<td><input type="button" value="   /  " onClick="enter(this.form, divide)">

 

<tr><td><input type="button" value="  4  " onClick="enter(this.form, four)">

 

<td><input type="button" value="  5  " onClick="enter(this.form, five)">

 

<td><input type="button" value="  6  " onClick="enter(this.form, six)">

 

<td><input type="button" value="  *  " onClick="enter(this.form, multiply)">

 

<tr><td><input type="button" value="  1  " onClick="enter(this.form, one)">

 

<td><input type="button" value="  2  " onClick="enter(this.form, two)">

 

<td><input type="button" value="  3  " onClick="enter(this.form, three)">

 

<td><input type="button" value="   -  " onClick="enter(this.form, minus)">

 

<tr><td colspan=2><input type="button" value="       0       " onClick="enter(this.form, zero)">

 

<td><input type="button" value="   .  " onClick="enter(this.form, decimal)">

 

<td><input type="button" value="  +  " onClick="enter(this.form, plus)">

 

<tr><td colspan=2><input type="button" value="   =   " onClick="compute(this.form)">

 

<td colspan=2><input type="button" value="AC" size= 3 onClick="clear(this.form)"> </table>

 

</form>

0 Comments

Wed

04

Mar

2009

23、FTP页面登录

23FTP页面登录

<html>

 

<head>

<title>网页特效---FTP页面登录</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

 

<script janguage="javascript">

 

<!--

 

// Title: JavaScript - FTP log-on script

 

 

 

function goFtpSite() {

 

document.location.href = "ftp://" + document.ftp.login.value + ":" + document.ftp.password.value + "@" + document.ftp.url.value;

 

}

 

 

 

//-->

 

</script>

</head>

 

<body>

 

<table cellspacing="1" width="500" align="center">

<tbody>

  <tr>

    <td align="center"><strong style="font-weight: 400"><font face="隶书" color="#FF0000" size="5">FTP页面登录</font></strong></td>

  </tr>

  <tr>

    <td align="center" valign="middle">

      <p align="center"> </p>

      <p align="center"> </td>

  </tr>

</tbody>

</table>

 

<table border="0" cellpadding="0" cellspacing="0" width="500" align="center">

  <tr>

    <td align="left" valign="top" width="15%"> </td>

    <td align="left" bgcolor="#0099FF" valign="top" width="85%">

    <font face="楷体_GB2312"

    size="3" color="#FFFF00">    </font>

    <font face="宋体" style="font-size: 9pt">

    如果读者有自己的个人主页,或上传过文件,想必对

    FTP登录软件不会陌生吧!其实FTP登录还可以用在其他很多地方,象早期的一些新闻组、论坛等都需要FTP登录,也许你认为实现FTP登录功能是需要复杂编程技术的,其实很简单,爪哇脚本程序的强大功能,可以帮助你轻松实现,放一个在你的网页中,可以使你的网页顿显专业水准。</font></td>

  </tr>

  <tr>

    <td align="left" width="15%" valign="top"> </td>

    <td align="left" bgcolor="#FFFFFF" valign="top" width="85%"><form name="ftp">

      <table border="0" cellpadding="1" cellspacing="1" bgcolor="#000000" align="center">

        <tr>

          <td><table border="0" cellspacing="0" cellpadding="5" align="center">

            <tr bgcolor="#bbbbbb">

              <td width="75" align="right"><font face="arial,helvetica" size="-1">Ftp:// </font></td>

              <td><font face="arial,helvetica" size="-1"><input type="text" size="15" name="url"> </font></td>

            </tr>

            <tr bgcolor="#dddddd">

              <td align="right"><font face="arial,helvetica" size="-1">Login: </font></td>

              <td><font face="arial,helvetica" size="-1"><input type="text" size="15" name="login"

              maxlength="20"> </font></td>

            </tr>

            <tr bgcolor="#bbbbbb">

              <td align="right"><font face="arial,helvetica" size="-1">Password: </font></td>

              <td><font face="arial,helvetica" size="-1"><input type="password" size="15"

              name="password" maxlength="20"> </font></td>

            </tr>

            <tr bgcolor="#ffffff">

              <td colspan="2" align="center"><font face="arial,helvetica" size="-2"><input type="button"

              onclick="goFtpSite();" value="LOG-IN"> <input type="reset" value="CLEAR"> </font></td>

            </tr>

          </table>

          </td>

        </tr>

      </table>

    </form>

    </td>

  </tr>

</table>

 

</body>

 

0 Comments

Wed

04

Mar

2009

22、进入页面弹出收藏夹

22、进入页面弹出收藏夹

<html>

<head>

<title>网页特效--进入页面弹出收藏夹提示</title>

<style type="text/css">

<!--

body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}

A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }

 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }

a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

 

<body>

<br>

<br>

<center><font color=red face="隶书" size=6>进入弹出收藏夹</font></center>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var expDays = 7;

 

url = "http://7stk.com";

title = "网页制作特效";

 

// Cookie code from The JavaScript Source

function GetCookie (name) { 

var arg = name + "="; 

var alen = arg.length; 

var clen = document.cookie.length; 

var i = 0; 

while (i < clen) {   

var j = i + alen;   

if (document.cookie.substring(i, j) == arg)     

return getCookieVal (j);   

i = document.cookie.indexOf(" ", i) + 1;   

if (i == 0) break;  

} 

return null;

}

function SetCookie (name, value) { 

var argv = SetCookie.arguments; 

var argc = SetCookie.arguments.length; 

var expires = (argc > 2) ? argv[2] : null; 

var path = (argc > 3) ? argv[3] : null; 

var domain = (argc > 4) ? argv[4] : null; 

var secure = (argc > 5) ? argv[5] : false; 

document.cookie = name + "=" + escape (value) +

((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +

((path == null) ? "" : ("; path=" + path)) + 

((domain == null) ? "" : ("; domain=" + domain)) +   

((secure == true) ? "; secure" : "");

}

function DeleteCookie (name) { 

var exp = new Date(); 

exp.setTime (exp.getTime() - 1); 

var cval = GetCookie (name); 

document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

var exp = new Date();

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function amt(){

var count = GetCookie('count')

if(count == null) {

SetCookie('count','1')

return 1

}

else {

var newcount = parseInt(count) + 1;

DeleteCookie('count')

SetCookie('count',newcount,exp)

return count

   }

}

function getCookieVal(offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1)

endstr = document.cookie.length;

return unescape(document.cookie.substring(offset, endstr));

}

 

function checkCount() {

var count = GetCookie('count');

if (count == null) {

count=1;

SetCookie('count', count, exp);

 

if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

window.external.AddFavorite (url,title);

}

else {

var msg = "Don't forget to bookmark us!";

if(navigator.appName == "Netscape") msg += "  (CTRL-D)";

alert(msg);

   }

}

else {

count++;

SetCookie('count', count, exp);

   }

}

checkCount();

//  End -->

</script>

<br><center>

<table border=5 bordercolor=blue borderlight=green>

<tr><td align=center><font size=4 color=red face="Arial, Helvetica, sans-serif"><strong>进入就看到效果了吧!</strong></font></td></tr>

</table></center>

<br>

<br>

<br>

<br>

</body>

</html>

1 Comments

Wed

04

Mar

2009

21、点击弹出窗口

21、点击弹出窗口

<html>

<head>

<title>网页特效---很有意思的跳出窗口</title>

<style type="text/css">

<!--

body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}

A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }

 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }

a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

 

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<body bgcolor="#fef4d9">

<br>

<br>

<center> </center>

<br>

<center>

<table border=0 bordercolor=#111111 borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">

<tr><td align=center> </td></tr><tr><td align=center><a href="" onMouseover="alert('为什么把鼠标放到这里?');

alert('我不是说过不允许的吗?');

alert('你还碰');

alert('呀,上瘾了是不是。');

alert('不准点了!');

alert('');

alert('');

alert('');

alert('');

alert('');

alert('');

alert('');

alert('真拿你没办法');

alert('还点?');

alert('I 服了 YOU');

alert('进来吧!');

document.bgColor='black';

document.fgColor='White';

window.href='../index.htm';">不许碰我</a>

 

</td></tr>

</table></center>

  

<br>

<br>

<br>

<br>

</body>

</html>

0 Comments

Wed

04

Mar

2009

20、飞舞的窗口

20、飞舞的窗口

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

 

<title>网页特效---飞舞的窗口</title>

</head>

 

<body>

 

 

<SCRIPT language=javascript>

function WinScroll(direction,xWidth,xHeight){

if ((navigator.appVersion.indexOf('4')!= -1)){

self.resizeTo(xWidth,xHeight)

if (direction == 1){

self.moveTo((screen.availWidth-xWidth)/2,screen.availHeight-10)

for (var c=1; c<=(screen.availHeight-(-xHeight))/2; c++)

self.moveTo((screen.availWidth-xWidth)/2,screen.availHeight-c)

}

if (direction == 2){

var x=screen.availHeight+screen.Height

self.moveTo((screen.availWidth-xWidth)/2,(screen.availHeight-x))

for (var c=0; c<=(screen.availHeight-(-xHeight/2)); c++)

self.moveTo((screen.availWidth-xWidth)/2,(screen.availHeight-x)+c)

}

if (direction == 3){

var x=screen.availWidth-10

self.moveTo(x,(screen.availHeight-xHeight)/2)

for (var c=1; c<=(x-(-xWidth))/2; c++)

self.moveTo((x-c),(screen.availHeight-xHeight)/2)

}

 

if (direction == 4){

var x=screen.availWidth+(xWidth-10)

self.moveTo((screen.availWidth-x),(screen.availHeight-xHeight)/2)

for (var c=1; c<=(screen.availWidth-(-xWidth))/2; c++)

self.moveTo(((screen.availWidth-x)+c),(screen.availHeight-xHeight)/2)

}

}

}

for (c=1; c<=4; c++) WinScroll(c,400,400)

</SCRIPT>

</body>

 

</html>

0 Comments

Wed

04

Mar

2009

19、卷动公告窗口

19、卷动公告窗口

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效---卷动公告窗口</title>

</head>

 

<body>

 

 

<style>

<!--

.drag{position:relative;cursor:hand

}

#scontentmain{

position:absolute;

width:150px;

}

#scontentbar{

cursor:hand;

position:absolute;

background-color:green;

height:15;

width:100%;

top:0;

}

#scontentsub{

position:absolute;

width:100%;

top:15;

background-color:lightyellow;

border:2px solid green;

padding:1.5px;

}

-->

</style>

<script language="JavaScript1.2">

<!--

var dragapproved=false

var zcor,xcor,ycor

function movescontentmain(){

if (event.button==1&&dragapproved){

zcor.style.pixelLeft=tempvar1+event.clientX-xcor

zcor.style.pixelTop=tempvar2+event.clientY-ycor

leftpos=document.all.scontentmain.style.pixelLeft-document.body.scrollLeft

toppos=document.all.scontentmain.style.pixelTop-document.body.scrollTop

return false

}

}

function dragscontentmain(){

if (!document.all)

return

if (event.srcElement.id=="scontentbar"){

dragapproved=true

zcor=scontentmain

tempvar1=zcor.style.pixelLeft

tempvar2=zcor.style.pixelTop

xcor=event.clientX

ycor=event.clientY

document.onmousemove=movescontentmain

}

}

document.onmousedown=dragscontentmain

document.onmouseup=new Function("dragapproved=false")

//-->

</script>

<div id="scontentmain">

<div id="scontentbar" >

<font size="2">

<img align="right" src="images/barbutton.gif" onClick="onoffdisplay()" width="17" height="15">

 

HELLO

</font></div><div id="scontentsub"><font size="2">

欢迎光临网页特效 网络因你而你精彩!

</font></div></div>

<script language="JavaScript1.2">

var w=document.body.clientWidth-195

var h=50

w+=document.body.scrollLeft

h+=document.body.scrollTop

 

var leftpos=w

var toppos=h

scontentmain.style.left=w

scontentmain.style.top=h

 

function onoffdisplay(){

if (scontentsub.style.display=='')

scontentsub.style.display='none'

else

scontentsub.style.display=''

}

 

function staticize(){

w2=document.body.scrollLeft+leftpos

h2=document.body.scrollTop+toppos

scontentmain.style.left=w2

scontentmain.style.top=h2

}

window.onscroll=staticize

 

</script>

</body>

 

</html>

0 Comments

Wed

04

Mar

2009

18、限时广告窗口

18、限时广告窗口

<html>

<head>

<meta http-equiv="Content-Language" content="zh-cn">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效---限时广告窗口</title>

</head>

 

<body>

 

 

<style type="text/css">

<!--

#sponsorAdDiv {position:absolute; height:1; width:1; top:0; left:0;}

-->

</style>

<SCRIPT LANGUAGE="JavaScript1.2">

adTime=5;

 

chanceAd=1;

var ns=(document.layers);

var ie=(document.all);

var w3=(document.getElementById && !ie);

adCount=0;

function initAd(){

        if(!ns && !ie && !w3) return;

        if(ie)                adDiv=eval('document.all.sponsorAdDiv.style');

        else if(ns)        adDiv=eval('document.layers["sponsorAdDiv"]');

        else if(w3)        adDiv=eval('document.getElementById("sponsorAdDiv").style');

        randAd=Math.ceil(Math.random()*chanceAd);

        if (ie||w3)

        adDiv.visibility="visible";

        else

        adDiv.visibility ="show";

        if(randAd==1) showAd();

}

function showAd(){

if(adCount<adTime*10){adCount+=1;

        if (ie){documentWidth  =document.body.offsetWidth/2+document.body.scrollLeft-20;

        documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}

        else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;

        documentHeight=window.innerHeight/2+window.pageYOffset-20;}

        else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;

        documentHeight=self.innerHeight/2+window.pageYOffset-20;}

        adDiv.left=documentWidth-200;adDiv.top =documentHeight-200;

        setTimeout("showAd()",100);}else closeAd();

}

function closeAd(){

if (ie||w3)

adDiv.display="none";

else

adDiv.visibility ="hide";

}

onload=initAd;

</script>

<div id="sponsorAdDiv" style="visibility:hidden">

<table width="450" height="350" bgcolor="008000"><tr><td>

<table width="445" height="345" bgcolor="F0FFF0"><tr><td>

欢迎光临网页特效 网络因你而精彩!<p> </p>

<p><span lang="zh-cn">进入页面时出现一个窗口,本例显示的时间为5</span></td></tr></table></td></tr></table></div>

 

</body>

 

</html>

0 Comments

Wed

04

Mar

2009

17、关闭窗口

17、关闭窗口

<script language="JavaScript">

 

function shutwin(){

window.close();

return;}

</script>

<a href="javascript:shutwin();">关闭本窗口</a>

 

0 Comments

Wed

04

Mar

2009

16、另类弹出式窗口

16、另类弹出式窗口

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效---另类弹出式窗口</title>

</head>

 

<body>

 

 

<script>

var theURL = "http://7stk.com";

var title = "test"

var windowWidth  = 478;

var windowHeight = 100;

var windowX = 100;

var windowY = 100;

var autocenter = false;

var autoclose = true;

var s="width="+windowWidth+",height="+windowHeight;

var beIE=document.all?true:false;

var done=new Object("no");

 

if(autocenter){

windowX = (window.screen.width-windowWidth)/2;

windowY = (window.screen.height-windowHeight)/2;

}

 

function doAgilePopup(){

  if (beIE){

  agilePopper = window.open("","popAgile","fullscreen,"+s);

  agilePopper.blur();

  window.focus();

  agilePopper.resizeTo(windowWidth,windowHeight);

  agilePopper.moveTo(windowX,windowY);

  var frameString=""+

"<html>"+

"<head>"+

"<title>"+title+"</title>"+

"</head>"+

"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+

"<frame name='top' src='"+theURL+"' scrolling=no>"+

"<frame name='bottom' src='about:blank' scrolling='no'>"+

"</frameset>"+

"</html>"

  agilePopper.document.open();

  agilePopper.document.write(frameString);

  agilePopper.document.close();

  }else{

  agilePopper=window.open(theURL,"popAgile","scrollbars=no,"+s);

  agilePopper.blur();

  window.focus();

  agilePopper.resizeTo(windowWidth,windowHeight);

  agilePopper.moveTo(windowX,windowY);

  }

  agilePopper.blur();

  if (autoclose){

  window.onunload = function(){agilePopper.close();}

  }

  done="okay";

}

 

</script>

<body onLoad="doAgilePopup()">

 

 

</body>

 

</html>

0 Comments

Wed

04

Mar

2009

15、跳出说明窗口

15、跳出说明窗口

<html>

<head>

<title>网页特效|Linkweb.cn/Js|---跳出说明窗口</title>

<style type="text/css">

<!--

body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}

A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }

 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }

a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

-->

</style>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

 

<body>

<br>

<br>

<center><font color=red face="隶书" size=6>跳出说明窗口</font></center>

<br>

<br><center>

<table border=0 bordercolor=blue borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">

<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></font></td></tr>

<tr><td align=center><SCRIPT LANGUAGE="Javascript">

// Please enter the number of people in your database

var peepNum = 6

 

// Please edit your page attributes here

var pageAtr = new Array(1)

pageAtr[0] = "#000000"                        // Pop Up Profile background color

pageAtr[1] = "#ffffff"                        // Pop Up Profile text color

 

// Please edit the names of the people in your profiles

var peepName = new Array(peepNum)

peepName[1] = "网页特效代码"                         // First person's name

peepName[2] = "John"                          // Second person's name

peepName[3] = "Joe"                           // Etc...

peepName[4] = "Ryan"

peepName[5] = "Jessica"

peepName[6] = "Mrs. Jacobson"

 

// Please edit the people's positions

var peepPos = new Array(peepNum)

peepPos[1] = "提供网页制作代码"           // First person's position

peepPos[2] = "The Pascal Guy"                 // Second person's position

peepPos[3] = "Soccer guy and mudder"          // Etc...

peepPos[4] = "Serves no useful function"

peepPos[5] = "She complains a lot"

peepPos[6] = "The *snicker snicker* teacher"

 

// Please edit the personal quote

var peepAd = new Array(peepNum)

peepAd[1] = "你有什么意见"          // First person's quote

peepAd[2] = "Graphix are easier"              // Second person's quote

peepAd[3] = "I like to play muds"             // Etc...

peepAd[4] = "Huh? What about what?"

peepAd[5] = "I don't understand..."

peepAd[6] = "There's too much screwing around here"

 

// *#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)

// *#)      Please stop editing at this point      *#)

// *#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)*#)

 

function makePupWin(){

  PUP = window.open('','PUP','width=300,height=160,toolbar=0,directories=0,status=1,menu=0,scrollbars=no,resizable=no,copyhistory=no,location=0');

}

 

// This is a bit hard to edit if you don't do javascript.

// Here you can edit the HTML of the profile window

// Keep in mind you'll get errors if you use " without a slash (\")

function makePUP(num){

  makePupWin();

  PUP.document.write("<HTML>\n<HEAD>\n<TITLE>Profile for: " + peepName[num] + "</TITLE>");

  PUP.document.write("\n</HEAD>\n<BODY BGCOLOR=\"" + pageAtr[0] + "\" TEXT=\"" + pageAtr[1] + "\">");

  PUP.document.write("\n<CENTER>\n<TABLE WIDTH=\"250\" BORDER=\"1\" HEIGHT=\"100\">\n<TR>\n<TD>Name</TD><TD><CENTER>" + peepName[num] + "</CENTER></TD>");

  PUP.document.write("\n<\TR>\n<TR>\n<TD>Title:</TD><TD><CENTER>" + peepPos[num] + "</CENTER></TD>");

  PUP.document.write("\n<\TR>\n<TR>\n<TD>Quote:</TD><TD><CENTER>" + peepAd[num] + "</CENTER></TD>");

  PUP.document.write("\n<\TR>\n</TABLE>\n<FORM>\n<INPUT TYPE=\"button\" VALUE=\"Close Profile\" onClick=\"self.close();\">\n</FORM>\n</BODY>\n</HTML>");

  PUP.status=(peepName[num] + "'s Pop Up Profile");

  PUP.document.close();

}

  </SCRIPT>

<CENTER>

<FORM>

<INPUT TYPE="button" VALUE="网页特效" onClick="makePUP(1)"><P>

<INPUT TYPE="button" VALUE="John's profile" onClick="makePUP(2)"><P>

<INPUT TYPE="button" VALUE="Joe's profile" onClick="makePUP(3)"><P>

<INPUT TYPE="button" VALUE="Ryan's profile" onClick="makePUP(4)"><P>

<INPUT TYPE="button" VALUE="Jessica's profile" onClick="makePUP(5)"><P>

<INPUT TYPE="button" VALUE="Mrs. Jacobson's profile" onClick="makePUP(6)"><P>

</FORM>

</CENTER>

</td></tr></table></center>

<br>

<br>

<center>

 <SCRIPT LANGUAGE="JavaScript">

 

<!-- hide

 

function goHist(a)

 

{

 

   history.go(a);

 

}

 

//-->

 

</script></center>

<br>

<br>

</body>

</html>

0 Comments

Wed

04

Mar

2009

14、循环的警告框

14、循环的警告框

脚本说明:

第一步:把如下代码加入<head>区域中

<script language="JavaScript">

<!--

function win() {

var h= document.winfrm.hig.value

var w= document.winfrm.wid.value

testWindow=window.open("about:blank",'testwin','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h +'');

testWindow.document.writeln("<head><title>skynew.net-skynew.net-测试窗口</title></head>");

testWindow.document.writeln("<body bgcolor=#ffffcc>");

testWindow.document.writeln("该窗口已经按照你要求的大小打开了!<p>");

testWindow.document.writeln("如何使用就在于你的创意了!<a href=http://www.skynew.net>天新网</a></body>");

testWindow.document.writeln('');

}

// -->

</script>

 

第二步:把如下代码加入<body>区域中

<form name="winfrm">

窗口宽度:

<input type="text" name="wid" maxlength="3">

<br>

窗口高度:

<input type="text" name="hig" maxlength="3">

<br>

<input type="button" name="s" value="开始测试" onClick="win()" class="yk9">

</form>

 

0 Comments

Wed

04

Mar

2009

13、花俏的转动的窗口

13、花俏的转动的窗口

<head>

<meta name="GENERATOR" content="Microsoft FrontPage 6.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<title>网页特效--花俏的转动的窗口</title>

</head>

<script>     

window.scrollBy(0, 100)     

window.resizeTo(0,0)     

window.moveTo(0,0)     

document.bgColor=0x000000     

document.fgColor=0x000000     

//setInterval("move()",30);     

setTimeout("move()", 1);     

var mxm=50     

var mym=25     

var mx=0     

var my=0     

var sv=50     

var status=1     

var szx=0     

var szy=0     

var c=255     

var n=0     

var sm=30     

var cycle=2     

var done=2     

function move()     

       {     

       if (status == 1)     

              {     

              mxm=mxm/1.05     

              mym=mym/1.05     

              mx=mx+mxm     

              my=my-mym     

              mxm=mxm+(400-mx)/100     

              mym=mym-(300-my)/100     

              window.moveTo(mx,my)     

              rmxm=Math.round(mxm/10)     

              rmym=Math.round(mym/10)     

              if (rmxm == 0)     

                     {     

                     if (rmym == 0)     

                            {     

                            status=2     

                            }     

                     }     

              }     

       if (status == 2)     

              {     

              sv=sv/1.1     

              scrratio=1+1/3     

              mx=mx-sv*scrratio/2     

              my=my-sv/2     

              szx=szx+sv*scrratio     

              szy=szy+sv     

              window.moveTo(mx,my)     

              window.resizeTo(szx,szy)     

              if (sv < 0.1)     

                     {     

                     status=3     

                     }     

              }     

       if (status == 3)     

              {     

              document.fgColor=0xffffFF     

              c=c-16     

              document.bgColor=0xffffFF     

              if (c<0)     

                     {status=8}     

              }     

       if (status == 4)     

              {     

              c=c+16     

              document.bgColor=c*65536     

              document.fgColor=(255-c)*65536     

              if (c > 239)     

                     {status=5}     

              }     

       if (status == 5)     

              {     

              c=c-16     

              document.bgColor=c*65536     

              document.fgColor=(255-c)*65536     

              if (c < 0)     

                     {     

                     status=6     

                     cycle=cycle-1     

                     if (cycle > 0)     

                            {     

                            if (done == 1)     

                                   {status=7}     

                            else     

                                   {status=4}     

                            }     

                     }     

              }     

       if (status == 6)     

              {     

              document.title = ""     

              alert("")     

              cycle=2     

              status=4     

              done=1     

              }     

       if (status == 7)     

              {     

              c=c+4     

              document.bgColor=c*65536     

              document.fgColor=(255-c)*65536     

              if (c > 128)     

                     {status=8}     

              }     

       if (status == 8)     

              {     

              window.moveTo(0,0)     

              sx=screen.availWidth     

              sy=screen.availHeight     

              window.resizeTo(sx,sy)     

              status=9     

}     

       var timer=setTimeout("move()",0.3)     

       }     

</script>

 

0 Comments

Wed

04

Mar

2009

12、设定时间弹出窗口

12、设定时间弹出窗口

脚本说明:

第一步:把如下代码加入<head>区域中

<script language="JavaScript">

<!--

function win() {

var h= document.winfrm.hig.value

var w= document.winfrm.wid.value

testWindow=window.open("about:blank",'testwin','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h +'');

testWindow.document.writeln("<head><title>skynew.net-skynew.net-测试窗口</title></head>");

testWindow.document.writeln("<body bgcolor=#ffffcc>");

testWindow.document.writeln("该窗口已经按照你要求的大小打开了!<p>");

testWindow.document.writeln("如何使用就在于你的创意了!<a href=http://www.skynew.net>天新网</a></body>");

testWindow.document.writeln('');

}

// -->

</script>

 

第二步:把如下代码加入<body>区域中

<form name="winfrm">

窗口宽度:

<input type="text" name="wid" maxlength="3">

<br>

窗口高度:

<input type="text" name="hig" maxlength="3">

<br>

<input type="button" name="s" value="开始测试" onClick="win()" class="yk9">

</form>

0 Comments

Wed

04

Mar

2009

11、倒计时载入页面

11、倒计时载入页面

脚本说明:

第一步:把如下代码加入<head>区域中:

 <META HTTP-EQUIV="REFRESH" CONTENT="11; URL=14.htm">

 

 

第二步:<body>中加入如下代码:

 <META HTTP-EQUIV="REFRESH" CONTENT="11; URL=14.htm">

 

 <script language="JavaScript">

 

 startday = new Date();

 clockStart = startday.getTime();

 

 function initStopwatch()

 {

  var myTime = new Date();

         var timeNow = myTime.getTime(); 

         var timeDiff = timeNow - clockStart;

         this.diffSecs = timeDiff/1000;

         return(this.diffSecs);

 }

 

 function getSecs()

 {

         var mySecs = initStopwatch();

         var mySecs1 = ""+mySecs;

         mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")) + " secs.";

         document.form1.timespent.value = mySecs1

         window.setTimeout('getSecs()',1000);

 }

 

 

 </script>

 

 

  <center>

 This page will change in 10 seconds:

 <form name=form1><input size=9 name=timespent></form>

 </center>

 

 

第三步:把<body>中内容改为:

<body bgcolor="#fef4d9" onLoad="window.setTimeout('getSecs()',1)">

 

0 Comments

Wed

04

Mar

2009

10、特殊按钮

10、特殊按钮

脚本说明:

把如下代码加入<body>区域中

<input type="button" value="7stk.com" onClick="window.open('http://www.7stk.com', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=490,height=320,left=0,top=0')" name="Input">

0 Comments

Wed

04

Mar

2009

9、定制打开的窗口

 

9、定制打开的窗口

脚本说明:

第一步:把如下代码加入<head>区域中

<script language="JavaScript">

<!--

function win() {

var h= document.winfrm.hig.value

var w= document.winfrm.wid.value

testWindow=window.open("about:blank",'testwin','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h +'');

testWindow.document.writeln("<head><title>skynew.net-skynew.net-测试窗口</title></head>");

testWindow.document.writeln("<body bgcolor=#ffffcc>");

testWindow.document.writeln("该窗口已经按照你要求的大小打开了!<p>");

testWindow.document.writeln("如何使用就在于你的创意了!<a href=http://www.skynew.net>天新网</a></body>");

testWindow.document.writeln('');

}

// -->

</script>

 

第二步:把如下代码加入<body>区域中

<form name="winfrm">

窗口宽度:

<input type="text" name="wid" maxlength="3">

<br>

窗口高度:

<input type="text" name="hig" maxlength="3">

<br>

<input type="button" name="s" value="开始测试" onClick="win()" class="yk9">

</form>

0 Comments

Wed

04

Mar

2009

8、设置默认首页

8、设置默认首页

脚本说明:

把如下代码加入<body>区域中

<span  onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.7stk.com');"  style="CURSOR: hand"><br>将本站设置为首页</a></span>

 

1 Comments

Wed

04

Mar

2009

7、链接确认按钮

7、链接确认按钮

脚本说明:

把如下代码加入<body>区域中

<form action="file:///c|/"><input type="submit" value="c:\ drive"></form>

<p>

<form action="file:///a|/"><input type="submit" value="a:\ drive"></form>

<p>

<form action="file:///b|/"><input type="submit" value="b:\ drive"></form>

<p>

<form action="file:///d|/"><input type="submit" value="d:\ drive"></form>

<p>

<form action="file:///e|/"><input type="submit" value="e:\ drive"></form>

0 Comments

Wed

04

Mar

2009

6、确认连接代码

6、确认连接代码

脚本说明:

 

把如下代码加入<body>区域中

 

<script language="">

 

function winconfirm(){

 

       question = confirm("你确认要到“www.7stk.com”吗?")

 

       if (question != "0"){

 

              window.open("http://www.7stk.com")

 

       }

 

}

 

</script>

 

<a href="javascript:winconfirm()">南京有线宽带网</a>

 

0 Comments

Wed

04

Mar

2009

5、点击加入收藏夹

5、点击加入收藏夹

脚本说明:

 

第一步:把如下代码加入<head>区域中

 

<script language="javascript">

 

function bookmark(){

 

window.external.AddFavorite('http://www.7stk.com', '网页特效代码')

}

 

</script>

 

 

 

第二步:<body>中内容改为:

 

<body bgcolor="#fef4d9" onunload="bookmark()">

 

0 Comments

Wed

04

Mar

2009

4、离开启动收藏夹

4、离开启动收藏夹

脚本说明:

 

第一步:把如下代码加入<head>区域中

 

<script language="javascript">

 

function bookmark(){

 

window.external.AddFavorite('http://www.7stk.net', '网页特效代码')

 

}

 

</script>

 

 

 

第二步:<body>中内容改为:

 

<body bgcolor="#fef4d9" onunload="bookmark()">

 

1 Comments

Wed

04

Mar

2009

3、检测浏览器去过站点

3、检测浏览器去过站点

脚本说明:

把如下代码加入<body>区域中

<script>

var times=history.length;

document.write('此浏览器已经去过'+times+'个站了。');

</script>

 

0 Comments

Wed

04

Mar

2009

2、集成Cookies

2、集成Cookies

脚本说明:

 

第一步:把如下代码加入<body>区域中

 

<SCRIPT language="JavaScript"><!--

 

function getCookieVal (offset)

 

   {

 

   var endstr = document.cookie.indexOf (";", offset);

 

   if (endstr == -1)

 

      endstr = document.cookie.length;

 

   return unescape(document.cookie.substring(offset, endstr));

 

   }

 

function GetCookie (name)

 

   {

 

   var arg = name + "=";

 

   var alen = arg.length;

 

   var clen = document.cookie.length;

 

   var i = 0;

 

   while (i < clen)

 

      {

 

      var j = i + alen;

 

      if (document.cookie.substring(i, j) == arg)

 

         return getCookieVal (j);

 

      i = document.cookie.indexOf(" ", i) + 1;

 

      if (i == 0)

 

         break;

 

      }

 

   return null;

 

   }

 

function SetCookie (name, value)

 

   {

 

   var argv = SetCookie.arguments;

 

   var argc = SetCookie.arguments.length;

 

   var expires = (2 < argc) ? argv[2] : null;

 

   var path = (3 < argc) ? argv[3] : null;

 

   var domain = (4 < argc) ? argv[4] : null;

 

   var secure = (5 < argc) ? argv[5] : false;

 

   document.cookie = name + "=" + escape (value) +

 

     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +

 

     ((path == null) ? "" : ("; path=" + path)) +

 

     ((domain == null) ? "" : ("; domain=" + domain)) +

 

       ((secure == true) ? "; secure" : "");

 

   }

 

function ResetCounts(name)

 

   {

 

   visits = 0;

 

   SetCookie("visits", visits, expdate , "java2000.wol.com.html", null, false);

 

   location.reload();

 

   }

 

//-->

 

</SCRIPT><br><SCRIPT language="JavaScript"><!--

 

var expdate = new Date();

 

 

 

var visits;

 

 

 

// Set expiration date to a year from now.

 

 

 

expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));

 

 

 

if(!(visits = GetCookie("visits")))

 

 

 

   visits = 0;

 

 

 

visits++;

 

 

 

SetCookie("visits", visits, expdate, "java2000.wol.com.html", null, false);

 

 

 

   if(visits == 1)

 

 

 

      document.write('<P><CENTER>Welcome Cadet '+username+'</CENTER>');

 

 

 

   if(visits == 2)

 

 

 

      document.write('<P><CENTER>Welcome Ensign '+username+'</CENTER>');

 

 

 

   if(visits == 3)

 

 

 

      document.write('<P><CENTER>Welcome Lieutenant '+username+'</CENTER>');

 

 

 

   if(visits == 4)

 

 

 

      document.write('<P><CENTER>Welcome Lieutenant-Commander '+username+'</CENTER>');

 

 

 

   if(visits == 5)

 

 

 

      document.write('<P><CENTER>Welcome Commander '+username+'</CENTER>');

 

 

 

   if(visits == 6)

 

 

 

      document.write('<P><CENTER>Welcome Vice-Admiral '+username+'</CENTER>');

 

 

 

   if(visits == 7)

 

 

 

      document.write('<P><CENTER>Welcome Admiral '+username+'</CENTER>');

 

 

 

   if(visits== 8)

 

 

 

      document.write('<P><CENTER>Welcome Demi-God '+username+'</CENTER>');

 

 

 

   if(visits== 9)

 

 

 

      document.write('<P><CENTER>Welcome Demi-God '+username+'</CENTER>');

 

 

 

   if(visits>=10)

 

 

 

      document.write('<P><CENTER>Welcome Master '+username+'</CENTER>');

 

 

 

 

 

 

 

//-->

 

 

 

</SCRIPT><br>

 

 

 

<FONT FACE=ARIAL size="2">

 

 

 

<b>Your access was granted from

 

<SCRIPT language="javascript">document.write(document.referrer)</SCRIPT><br>

 

Using <SCRIPT language="javascript">document.write(navigator.userAgent)</SCRIPT>

 

</b></font><br><SCRIPT language="JavaScript"><!--

 

var expdate = new Date();

 

 

 

var visits;

 

 

 

expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));

 

 

 

if(!(visits = GetCookie("visits")))

 

 

 

   visits = 0;

 

 

 

visits++;

 

 

 

SetCookie("visits", visits, expdate, "www.njcatv.net.html", null, false);

 

 

 

document.write(""+"你已经光临本页"+visits+" 次了.谢谢!");

 

 

 

 

 

//-->

 

 

 

</SCRIPT><br>

 

You arrived at <br><SCRIPT language="JavaScript"><!--

 

Stamp = new Date();

 

       var Hours;

 

       var Mins;

 

       var Time;

 

       Hours = Stamp.getHours();

 

       if (Hours >= 12) {

 

               Time = " P.M.";

 

       }

 

        else {

 

                Time = " A.M.";

 

        }

 

      

 

       if (Hours > 12) {

 

               Hours -= 12;

 

        }

 

       if (Hours == 0) {

 

               Hours = 12;

 

        }

 

       Mins = Stamp.getMinutes();

 

       if (Mins < 10) {

 

               Mins = "0" + Mins;

 

        }

 

      

 

       document.write('<font size="2" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>');

 

//-->

 

 

 

</SCRIPT><br>

 

The current time is:<br><SCRIPT language="JavaScript"><!--

 

function goback(){

 

alert("Good Bye!");

 

history.go(-1);

 

}

 

function gettheDate() {

 

Todays = new Date();

 

TheDate = "" + (Todays.getMonth()+ 1) +" / "+ Todays.getDate() + " / " +

 

Todays.getYear()

 

document.clock.date.value = TheDate;

 

}

 

// Navigation - Stop

 

// Netscapes Clock - Start

 

// this code was taken from Netscapes JavaScript documentation at

 

// www.netscape.com on Jan.25.96

 

 

 

var timerID = null;

 

var timerRunning = false;

 

function stopclock (){

 

        if(timerRunning)

 

                clearTimeout(timerID);

 

        timerRunning = false;

 

}

 

 

 

function startclock () {

 

        // Make sure the clock is stopped

 

        stopclock();

 

        gettheDate()

 

        showtime();

 

}

 

 

 

function showtime () {

 

        var now = new Date();

 

        var hours = now.getHours();

 

        var minutes = now.getMinutes();

 

        var seconds = now.getSeconds()

 

        var timeValue = "" + ((hours >12) ? hours -12 :hours)

 

        timeValue += ((minutes < 10) ? ":0" : ":") + minutes

 

        timeValue += ((seconds < 10) ? ":0" : ":") + seconds

 

        timeValue += (hours >= 12) ? " P.M." : " A.M."

 

        document.clock.face.value = timeValue;

 

        // you could replace the above with this

 

        // and have a clock on the status bar:

 

        // window.status = timeValue;

 

        timerID = setTimeout("showtime()",1000);

 

        timerRunning = true;

 

}

 

//-->

 

 

 

</SCRIPT><br><form name="clock" onSubmit="0">

 

<div align=center>

 

<b><font size="-1"></font></b>

 

<input type="text" name="date" size=12 value="">

 

<input type="text" name="face" size=12 value="">

 

</div>

 

</form>

 

 

 

第二步:<body>改为

 

<body bgcolor="#fef4d9" onLoad="startclock()">

 

 

0 Comments

Wed

04

Mar

2009

1、随登陆次数变提示

1、随登陆次数变提示

脚本说明:

 

把如下代码加入<body>区域中

 

<SCRIPT language="JavaScript"><!--

 

function getCookieVal(offset)

 

 

 

{var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)

 

 

 

endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));}function GetCookie(name)

 

 

 

{var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen)

 

 

 

{var j=i+alen;if(document.cookie.substring(i,j)==arg)

 

 

 

return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)

 

 

 

break;

 

 

 

}return null;}function SetCookie(name,value)

 

 

 

{var argv=SetCookie.arguments;var argc=SetCookie.arguments.length;var expires=(2<argc)?argv[2]:null;var path=(3<argc)?argv[3]:null;var domain=(4<argc)?argv[4]:null;var secure=(5<argc)?argv[5]:false;document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");}function ResetCounts(name)

 

 

 

{visits=0;SetCookie("visits",visits,expdate,"/",null,false);location.reload();}

 

//-->

 

 

 

</SCRIPT>

 

<SCRIPT language="JavaScript"><!--

 

var expdate=new Date();

 

var visits;//以下设置COOKIES时间为1,自己随便设置该时间..

 

 

 

expdate.setTime(expdate.getTime()+(24*60*60*1000*365));

 

 

 

if(!(visits=GetCookie("visits")))

 

 

 

visits=0;visits++;SetCookie("visits",visits,expdate,"/",null,false);//以下信息显示可以使用标准的HTML语法,自己随便设置。

 

 

 

document.write("你已经光临本页"+"<FONT COLOR=red>"+visits+"</FONT>"+"次!");if(visits==1)//来访1次的信息显示

 

 

 

document.write("<br>"+"欢迎光临本站,觉得本站内容如何?");if(visits==2)//来访2次的信息显示,以下类推,自己随便增加。

 

 

 

document.write("<br>"+"再次光临不胜容幸!今后要常来啊!欢迎订阅本站邮件列表。");if(visits==3)

 

 

 

document.write("<br>"+"常客,在本站的论坛发个帖子如何?");if(visits==4)

 

 

 

document.write("<br>"+"你这个疯子!");if(visits>=5)

 

 

 

document.write("<br>"+"疯狂的家伙!我真的非常喜欢你。");

 

//-->

 

</SCRIPT>

 

 

0 Comments