--------------------------------------------
说明 浏览器的状态栏里出现一个字接一个字往左跑的欢迎语!
<script language="JavaScript">
<!--
function statusMessageObject(p,d) {
this.msg = MESSAGE
this.out = " "
this.pos = POSITION
this.delay = DELAY
this.i = 0
this.reset = clearMessage
}
function clearMessage() {
this.pos = POSITION
}
var POSITION = 100
var DELAY = 5
var MESSAGE = "欢迎光临! Welcome to WWW.HELPOR.NET "
var scroll = new statusMessageObject()
function scroller() {
for (scroll.i = 0; scroll.i < scroll.pos; scroll.i++) {
scroll.out += " "
}
if (scroll.pos >= 0)
scroll.out += scroll.msg
else scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length)
window.status = scroll.out
scroll.out = " "
scroll.pos--
if (scroll.pos < -(scroll.msg.length)) {
scroll.reset()
}
setTimeout ('scroller()',scroll.delay)
}
function snapIn(jumpSpaces,position) {
var msg = scroll.msg
var out = ""
for (var i=0; i<position; i++)
{out += msg.charAt(i)}
for (i=1;i<jumpSpaces;i++)
{out += " "}
out += msg.charAt(position)
window.status = out
if (jumpSpaces <= 1) {
position++
if (msg.charAt(position) == ' ')
{position++ }
jumpSpaces = 100-position
} else if (jumpSpaces > 3)
{jumpSpaces *= .75}
else
{jumpSpaces--}
if (position != msg.length) {
var cmd = "snapIn(" + jumpSpaces + "," + position + ")";
scrollID = window.setTimeout(cmd,scroll.delay);
} else {
window.status=""
jumpSpaces=0
position=0
cmd = "snapIn(" + jumpSpaces + "," + position + ")";
scrollID = window.setTimeout(cmd,scroll.delay);
return false
}
return true
}
snapIn(100,0);
// -->
</script>
--------------------------------------------------
说明 有些人真是懒得可以,把别人做好的网页往自己网页的框架(Frame)里一放,别人的成果就变成了自己的,而且看不出该网页的真实地址!为了防止你的成果被这些人所剽窃,你就可以在你网页的HTML里加入下面这段代码,这样,你的网页便总是在整个窗口中打开了。
<Script LANGUAGE="JavaScript">
if(self!=top){top.location=self.location;}
</script>
------------------------------------------------
说明: javascript的容错脚本,有了它,你的页面就不会出现错误提示了。
<SCRIPT LANGUAGE="JavaScript">
<!--
function Helpor_net() {
return true;
}
window.onerror = Helpor_net();
// -->
</SCRIPT>
----------------------------------------------
用IE登录FTP服务器。
<script janguage="javascript">
<!--
function goFtpSite() {
document.location.href = "ftp://" + document.ftp.login.value + ":" + document.ftp.password.value + "@" + document.ftp.url.value;
}
//-->
</script>
<form name="ftp">
<table border="0" cellpadding="1" cellspacing="1" align="center" width="304">
<tr>
<td width="296">
<table border="0" cellspacing=0 cellpadding=5 align="center" width="292">
<tr bgcolor="#b5e1ff">
<td width="75" align="right"> <font face="arial,helvetica" size="-1" color="#008080">
Ftp:// </font> </td>
<td width="193"> <font face="arial,helvetica" size="-1">
<input type="text" size=30 name="url" style="border: 1 solid #0099FF">
</font> </td>
</tr>
<tr bgcolor="#ddf1ff">
<td align="right" width="75"> <font face="arial,helvetica" size="-1" color="#008080">UserName:
</font> </td>
<td width="193"> <font face="arial,helvetica" size="-1">
<input type="text" size="15" name="login" maxlength="20" style="border: 1 solid #0099FF">
</font> </td>
</tr>
<tr bgcolor="#b5e1ff">
<td align="right" width="75"> <font face="arial,helvetica" size="-1" color="#008080">
Password: </font> </td>
<td width="193"> <font face="arial,helvetica" size="-1">
<input type="password" size="15" name="password" maxlength="20" style="border: 1 solid #0099FF">
</font></td>
</tr>
<tr bgcolor="#ddf1ff">
<td colspan="2" align="center" width="280"> <font face="arial,helvetica" size="-2">
<input type=button onclick="goFtpSite();" value="登录" style="background-color: #0099FF; color: #FFFFFF; border: 1 solid #0099FF">
<input type=reset value="重写" style="color: #FFFFFF; background-color: #0099FF; border: 1 solid #0099FF">
</font> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
-----------------------------------------------------
说明 显示访客的系统信息
效果 我猜,你的系统是:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0),
对不对?
---------------
<script language="JavaScript">
document.write("我猜,你的系统是:"+navigator.userAgent+",对不对?")
-->
</script>
---------------------------------------------------
说明 显示访客的浏览器类型
<script language="JavaScript">
document.write("我猜,你的浏览器是"+navigator.appName+",对不对?")
-->
</script>
---------------------------------------------------
说明 显示访客的屏幕分辨率
<script language="JavaScript">
document.write("我猜,你的屏幕分辨率是"+screen.width+"x"+screen.height+",对不对?")
-->
</script>
--------------------------------------------------
说明 自动记录、显示页面更新时间
效果 本页最后更新日期: 05/06/2005 18:33:25
<script language="JavaScript">
<!--
document.write("本页最后更新日期: " + document.lastModified)
-->
</script>
-------------------------------------------------
说明 跟随页面弹出的窗口在规定时间内自动关闭,而且不作任何提示
效果 注意看弹出的那个窗口,它将在10秒钟后自动关闭!
<script language="JavaScript">
<!--
url="popup.htm"
window.open(url, 'www_helpor_net', 'width=468,height=60,resizable=1,scrollbars=no,left=100,top=50')
-->
</script>
然后,在相同目录下新建一个popup.htm网页(注意要与上面的url对应!),用于显示在弹出窗口中。在新建文件的源代码中加入如下代码:
<script language="JavaScript">
function closeit() {
setTimeout("self.close()",10000)
}
closeit()
</script>
----------------------------------------------
说明 记录访客的来访次数,并根据作出不同的提示信息
效果 你已经光临本页3次!
常客,在本站的论坛发个帖子如何?
<SCRIPT language="JavaScript">
<!--
function www_helpor_net(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 www_helpor_net(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)?""[s:3]"; expires="+expires.toGMTString()))+((path==null)?""[s:3]"; path="+path))+((domain==null)?""[s:3]"; domain="+domain))+((secure==true)?"; secure":"");
}
var expdate=new Date();
var visits;
expdate.setTime(expdate.getTime()+(24*60*60*1000*365)); //设置COOKIES时间为1年,自己随便设置该时间
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(""+"欢迎光临本站,觉得本站内容如何?");
if(visits==2)//来访2次的信息显示,以下类推,自己随便增加
document.write(""+"再次光临不胜容幸!今后要常来啊!欢迎点击本站广告。");
if(visits==3)
document.write(""+"常客,在本站的论坛发个帖子如何?");
if(visits==4)
document.write(""+"你这个疯子!");
if(visits>=5)
document.write(""+"疯狂的家伙!我真的非常喜欢你。");
//-->
</SCRIPT>
------------------------------------------------
说明 年月日都是用全中文显示
效果 公元二零零三年六月二十三日
<script language="JavaScript">
<!--
function number(index1){
var numberstring="一二三四五六七八九十";
if(index1 ==0) {document.write("十")}
if(index1 < 10){
document.write(numberstring.substring(0+(index1-1),index1))}
else if(index1 < 20 ){
document.write("十"+numberstring.substring(0+(index1-11),(index1-10)))}
else if(index1 < 30 ){
document.write("二十"+numberstring.substring(0+(index1-21),(index1-20)))}
else{
document.write("三十"+numberstring.substring(0+(index1-31),(index1-30)))}
}
var today1 = new Date()
var month = today1.getMonth()+1
var date = today1.getDate()
var day = today1.getDay()
document.write("公元二零零三年")
number(month)
document.write("月")
number(date)
document.write("日")
//-->
</script>
--------------------------------------------------
说明 六种风格时间显示,一定有你喜欢的!
效果 风格一: 星期五,6月23日,2006年
风格二: 11:05:37上午
风格三: 星期五,6月23日,2006年 11:05:37上午
风格四: 6/23/06
风格五: 11:05:37
风格六: Fri Jun 23 11:05:37 UTC+0800 2006
--------------------
<SCRIPT language="javascript">
<!--
function initArray()
{
for(i=0;i<initArray.arguments.length;i++)
this=initArray.arguments;
}
var isnMonths=new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
var isnDays=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min<10)?"0":"")+min;clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"下午":"上午";
var stnr="";
var ns="0123456789";
var a="";
function getFullYear(d)
{
yr=d.getYear();if(yr<1000)
yr+=1900;return yr;}
document.write("<table>");
//下面各行分别是一种风格,把不需要的删掉即可
document.write("<TR><TD>风格一:</TD><TD>"+isnDays[today.getDay()]+","+isnMonths[today.getMonth()]+""+today.getDate()+"日,"+getFullYear(today)+"年");
document.write("<TR><TD>风格二:</TD><TD>"+clckh+":"+clckm+":"+clcks+""+clck+"</TD></TR>");
document.write("<TR><TD>风格三:</TD><TD>"+isnDays[today.getDay()]+","+isnMonths[today.getMonth()]+""+today.getDate()+"日,"+getFullYear(today)+"年 "+clckh+":"+clckm+":"+clcks+""+clck+"</TD></TR>");
document.write("<TR><TD>风格四:</TD><TD>"+(today.getMonth()+1)+"/"+today.getDate()+"/"+(getFullYear(today)+"").substring(2,4)+"</TD></TR>");
document.write("<TR><TD>风格五:</TD><TD>"+hrs+":"+clckm+":"+clcks+"</TD></TR>");
document.write("<TR><TD VALIGN=TOP>风格六:</TD><TD>"+today+"</TD></TR>");
document.write("</table>");
//-->
</SCRIPT>
------------------------------------------------
说明 在鼠标后面跟着一串飘动的字符
效果 看看就知道啦!
<style type="text/css">
.spanstyle {
COLOR: #00cccc; FONT-FAMILY: 宋体; FONT-SIZE: 10pt; POSITION: absolute; TOP: -50px; VISIBILITY: visible
}
</style>
<script>
var x,y
var step=18
var flag=0
var message="★网页特效世界欢迎你的光临!"
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos=-50
}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos=-200
}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
function www_helpor_net() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos=xpos[i-1]+step
ypos=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos
thisspan.posTop=ypos
}
}
else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos=xpos[i-1]+step
ypos=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos
thisspan.top=ypos
}
}
var timer=setTimeout("www_helpor_net()",30)
}
for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message)
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
www_helpor_net();
// -->
</script>
---------------------------------------------
首页不显示详细代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META name="keywords" content="java, javascript, js, scripts,dHTML,HTML,javascripts,JavaScript,asp,php,JSP,网页制作特效,源代码,">
<title>网页特效集锦(www.helpor.net)</title>
</head>
<FRAMESET border=0 frameSpacing=0 rows="*" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<FRAME border=0 name=fraDTBar src="http://code.helpor.net/">
<!--
<FRAME border=0 name=frameBtm src="bottom_frame.php">
-->
</FRAMESET>
</html>
----------------------------------------------
说明: 真正的全屏显示,只能用ALT+F4关闭
<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'www_helpor_net', 'fullscreen')">
----------------------------------------
下雨特效
<script language="JavaScript">
<!--
var no = 50;
var speed = 1;
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var s, x, y, sn, cs;
var a, r, cx, cy;
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
else
if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
x = new Array();
y = new Array();
r = new Array();
cx = new Array();
cy = new Array();
s = 8;
for (i = 0; i < no; ++ i) {
initRain();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><font color=\"red\">");
document.write(",</font></layer>");
}
else {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><font color=\"red\">");
document.write(",</font></layer>");
}
}
else
if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"OSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"red\">");
document.write(",</font></div>");
}
else {
document.write("<div id=\"dot"+ i +"\" style=\"OSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"red\">");
document.write(",</font></div>");
}
}
}
function initRain() {
a = 6;
r = 1;
sn = Math.sin(a);
cs = Math.cos(a);
cx = Math.random() * doc_width + 1;
cy = Math.random() * doc_height + 1;
x = r * sn + cx;
y = cy;
}
function makeRain() {
r = 1;
cx = Math.random() * doc_width + 1;
cy = 1;
x = r * sn + cx;
y = r * cs + cy;
}
function updateRain() {
r += s;
x = r * sn + cx;
y = r * cs + cy;
}
function raindropNS() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x <= 1) || (x >= (doc_width - 20)) || (y >= (doc_height - 20))) {
makeRain();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
document.layers["dot"+i].top = y;
document.layers["dot"+i].left = x;
}
setTimeout("raindropNS()", speed);
}
function raindropIE() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x <= 1) || (x >= (doc_width - 20)) || (y >= (doc_height - 20))) {
makeRain();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
document.all["dot"+i].style.pixelTop = y;
document.all["dot"+i].style.pixelLeft = x;
}
setTimeout("raindropIE()", speed);
}
if (ns4up) {
raindropNS();
}
else
if (ie4up) {
raindropIE();
}
-->
</script>
-------------------------------------------------
透明FLASH背景代码
<DIV id=Layer0
style="z-index: 0; left: 50; visibility: visible; width: 771; position: absolute; top: 50; height: 539">
<OBJECT
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5 ,0,0,0
height=639 width=739 classid=clsid[s:4]27CDB6E-AE6D-11cf-96B8-444553540000>
<param name="_cx" value="17992">
<param name="_cy" value="9260">
<param name="FlashVars" value="-1">
<param name="Movie" value="背景地址">
<param name="Src" value="背景地址">
<param name="WMode" value="Transparent">
<param name="lay" value="-1">
<param name="Loop" value="-1">
<param name="Quality" value="High">
<param name="SAlign" value>
<<param name="Menu" value="-1">
<param name="Base" value>
<param name="AllowScriptAccess" value="always">
<param name="Scale" value="ShowAll">
<param name="DeviceFont" value="0">
<param name="EmbedMovie" value="0">
<param name="BGColor" value>
<param name="SWRemote" value>
<embed src="背景地址" quality="high" wmode="transparent" width="642" height="480" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi? P1_Prod_Version=ShockwaveFlash" ;;;;>
</OBJECT> |