网页特效集锦

典型特效
1、收藏本站
说明:点击即可把你的网站添加到浏览器的收藏菜单下
代码:
<span style="CURSOR: hand" onClick="window.external.addFavorite('http://www.[url]www.ycrc.com.cn[/url]','盐城人才网')" title="收藏盐城人
才网">收藏本站</span>

2、设为首页
说明:点击即可把你的网站设置为浏览器的起始页
代码:
<span
strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.ycrc.com.cn');"
style="CURSOR: hand">设为首页</span>

3、去掉超链接的下划线
说明:有时候看着那超链接的下划线挺讨厌的,把下面这段代码放到网页源代码<head>与</head>之间,下划线就无影无踪啦!
注意,网页的<body>标签里不能再有link之类的属性,否则本效果会失效!
代码:
<style TYPE="text/css">
<!--
A:link{text-decoration:none}
A:visited{text-decoration:none}
A:hover {color: #ff00ff;text-decoration:underline}
-->
</style>

4、自动刷新网页
说明:在HTML的与之间加入下面这段代码,则在5分钟之后正在浏览的页面将会自动变为target.html这一页。代码中300为刷新的延迟时间,以
秒为单位。targer.html为你想转向的目标页,若为本页则为自动刷新本页。
代码:
<meta http-equiv="refresh" content="300; url=target.html">

5、刷新本页
说明:点击即可刷新本页。
代码:
<a href="javascript:location.reload()" target="_self">刷新</a>

6、返回到上一页
说明:点击即可返回到上一页面。
代码:
<a href="javascript:history.back(-1)">返回上一页</a>

7、跳出小窗口
说明:在打开有下面这段代码的页面时将会跳出一个468x60大小的小窗口。“window.html”为跳出的小窗口里所要显示的网页。toolbar、sta
tus、menubar、scrollbars、设置小窗口的工具栏、状态栏、菜单栏及滚动条的有无,resizable设置是否可让浏览者改变小窗口大小,width
、height设置小窗口的宽度以及高度。(不过这样的小窗口一般是不受欢迎的哦!)
代码:
<script language="JavaScript">
window.open("window.html","www_ycrc_com_cn","toolbar=no, status=no,menubar=no,
scrollbars=no,resizable=no,width=468,height=60,left=200,top=50");
</script>

8、自动关闭窗口
说明:在网页源代码中加入下面的代码,则该窗口将在20秒钟之后自动关闭!这与跳出式小窗口配合使用是再好不过啦!代码中“i=20”表示
关闭的延迟时间为20秒,可任意修改。
代码:
<script language="javascript">
<!--
function clock(){i=i-1
document.title="本窗口将在"+i+"秒后自动关闭!";
if(i>0)setTimeout("clock();",1000);
else self.close();}
var i=20
clock();
//-->
</script>

9、给页面加保护
说明:如果你不想让辛辛苦苦做出来的东西被人轻易地Copy&Paste走的话,不妨在HTML里加入下面这段代码。当在网页里按下鼠标右键时,出
现的不是想要的快捷菜单而是一个警告窗口。“\n\n”表示换行。
代码:
<script language="JavaScript">
function ycrc_com_cn()
{
if (event.button==2)alert(' 仅供浏览!谢谢!\n\n若有问题请与我联系! ')
}
</script>

然后把<body> 改为
<body onmousedown="ycrc_com_cn()">

10、固定字号大小
说明:你是否有过这样的经历:一个布置得很好的网页,当浏览时把浏览器的字号设置成大或小时,漂亮的网页马上面目全非了。因为字的大
小变了,版式自然乱了。现在好了,只要把下面这段代码加入到网页源文件的<head>与</head>之间就行了(对用<font>标签定义的文字无效)。
代码:
<style type="text/css">
<!--
body {font-size:9pt}
td {font-size:9pt}
-->
</style>

11、状态栏里的动态欢迎语
说明:浏览器的状态栏里出现一个字接一个字往左跑的欢迎语!
代码:
<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 [url]WWW.YCRC.COM.CN[/url] "
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>

12、保护自己的页面不被别人放在框架中
说明:有些人真是懒得可以,把别人做好的网页往自己网页的框架(Frame)里一放,别人的成果就变成了自己的,而且看不出该网页的真实地址
!为了防止你的成果被这些人所剽窃,你就可以在你网页的HTML里加入下面这段代码,这样,你的网页便总是在整个窗口中打开了。
代码:
<Script LANGUAGE="JavaScript">
if(self!=top){top.location=self.location;}
</script>
 
按钮特效

13、全屏显示
说明:真正的全屏显示,只能用ALT+F4关闭
代码:
<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'www_ycrc_com_cn',
'fullscreen')">

14、打开一个全屏窗口
说明:用按钮打开一个全屏窗口
代码:
<input type="button" onClick="www_ycrc_com_cn()" value="试试看" name="button">

<script>
<!--
function www_ycrc_com_cn(){
var targeturl="http://www.ycrc.com.cn"
newwin=window.open("","","scrollbars")
if (document.all){
newwin.moveTo(0,0)
newwin.resizeTo(screen.width,screen.height)
}
newwin.location=targeturl
}
//-->
</script>

15、各种用途的按钮大集合
说明:各种用途的按钮大集合
代码:
<input TYPE="button" NAME="view" VALUE="查看源代码" OnClick="window.location='view-source:' +window.location.href" >

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

<input TYPE="button" VALUE="刷新按钮一" ONCLICK="ReloadButton()">
<script language="JavaScript">
<!--
function ReloadButton(){location.href="3.html";}
// -->
</script>

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

<input TYPE="button" VALUE="回首页按钮" ONCLICK="HomeButton()">
<script language="JavaScript">
<!--
function HomeButton(){location.href="http://www.ycrc.com.cn";}
// -->
</script>

<input TYPE="button" VALUE="弹出警告框" ONCLICK="AlertButton()">
<script language="JavaScript">
<!--
function AlertButton(){window.alert("今天你喝了没有?:)");}
// -->
</script>

<p>
<input TYPE="button" VALUE="状态栏信息" ONCLICK="StatusButton()">
<script language="JavaScript">
<!--
function StatusButton(){window.status="你好吗?:)";}
// -->
</script>

<input TYPE="button" VALUE="背景色变换" onClick="BgButton()">
<script language="JavaScript">
<!--
function BgButton(){
if (document.bgColor=='#3399ff')
{document.bgColor='#00ccff';}
else{document.bgColor='#3399ff';}
}
// -->
</script>

<input TYPE="button" VALUE="打开新窗口" ONCLICK="NewWindow()">
<script language="JavaScript">
<!--
function
NewWindow(){window.open("http://www.ycrc.com.cn","","height=600,width=800,left=10,top=10,status=no,location=no,toolbar=no,
directories=no,menubar=no");}
// -->
</script>

16、特殊效果的按钮
说明:特殊效果的按钮
代码:
<style type="text/css">
<!--
.over {color:yellow; background: navy}
.down {color:yellow; background: navy; font-style: italic}
-->
</style>
<input
type="Button" value="按钮也疯狂" name="Button"
onMouseOver="this.className='over';"
onMouseOut="this.className='';this.value='按钮也疯狂'"
onMouseDown="this.className='down';"
onMouseUp="this.className='over';"
onClick="this.value='我真的好喜欢你!'">

17、让屏幕抖动一阵
说明:让屏幕抖动一阵
代码:
<input type="button" value="地震啦!!!">
<script language="JavaScript">
<!--
function surfto(form) {
var myindex=form.select1.selectedIndex
if (form.select1.options[myindex].value != null) {
parent.main.location.href=form.select1.options[myindex].value;
}
}
// -->
</script>
<script language="JavaScript1.2">
<!--
function www_ycrc_com_cn(n) {
if (window.top.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
window.top.moveBy(0,i);
window.top.moveBy(i,0);
window.top.moveBy(0,-i);
window.top.moveBy(-i,0);
}
}
}
alert(" 没吓坏吧!!! ");
}
// -->
</script>
页面背景

18、文本向上循环滚动
说明:文本自动向上循环滚动,鼠标放到上面还会暂时停下来。
代码:
<table border="1" bordercolor="#000000" bgcolor="#6699ff" cellpadding="5" cellspacing="0">
<tr>
<td>
<script language=javascript>

document.write ("<marquee scrollamount='1' scrolldelay='30' direction= 'UP' width='200' id='ycrc_com_cn' height='150'
onmouseover='ycrc_com_cn.stop()' onmouseout='ycrc_com_cn.start()' Author:redriver; For more,visit:[url]www.ycrc.com.cn>[/url]")

document.write ("<h2><p align='center'><font color='#ffffff' face='黑体'>偶 然</font></h2>")
document.write ("<p align='right'><a href='#' target='_blank'><font color='#ffffff'>徐志摩</font></a> ")
document.write ("<p><font color='#ffffff'> ")
document.write ("<br>我是天空里的一片云,")
document.write ("<br>偶尔投影在你的波心―― ")
document.write ("<br>你不必讶异, ")
document.write ("<br>更无须欢喜―― ")
document.write ("<br>在转瞬间消灭了踪影。")
document.write ("<br>")
document.write ("<br>你我相逢在黑暗的海上,")
document.write ("<br>你有你的,我有我的,方向;")
document.write ("<br>你记得也好, ")
document.write ("<br>最好你忘掉, ")
document.write ("<br>在这交会时互放的光亮! ")
document.write ("</font>")

document.write ("</marquee> ")
</script>
</td>
</tr>
</table>

19、打字机打彩色文字
说明:文本自动向上循环滚动,鼠标放到上面还会暂时停下来。
代码:
<DIV class=ttl1 id=ttl0><SPAN class=ttl1></SPAN></DIV>
<SCRIPT language="JavaScript">
<!--

var layers = document.layers, style = document.all, both = layers || style, idme=908601;
if (layers) { layerRef = 'document.layers'; styleRef = ''; } if (style) { layerRef = 'document.all'; styleRef = '.style'; }

function writeOnText(obj, str) {
if (layers) with (document[obj]) { document.open(); document.write(str); document.close(); }
if (style) eval(obj+'.innerHTML= str');
}
//以下是输出的内容,自己修改即可。
var dispStr = new Array(
"<font color=red size=3>欢迎光临“盐城人才网”...</font><br><font color=green size=3>你知道怎样在你的网页中做一个很酷的网页菜
单吗?</font><br><font color=red size=3>你知道怎样让你的网页背景向上或向下移动吗?</font><br><font color=blue size=3>你知道怎样
在你的主页中任意位置显示一个时钟吗?</font><br><font color=red size=3>你知道怎样在主页中做特效文字吗?</font><br><font
color=black size=3>你知道怎样做一个很cool的日历吗?</font>"
);

var overMe=0;

function ycrc_com_cn(str, idx, idObj, spObj, clr1, clr2, delay, plysnd) {
var tmp0 = tmp1 = '', skip = 0;
if (both && idx <= str.length) {
if (str.charAt(idx) == '<') { while (str.charAt(idx) != '>') idx++; idx++; }
if (str.charAt(idx) == '&' && str.charAt(idx+1) != ' ') { while (str.charAt(idx) != ';') idx++; idx++; }
tmp0 = str.slice(0,idx);
tmp1 = str.charAt(idx++);

if (overMe==0 && plysnd==1) {
if (navigator.plugins[0]) {
if (navigator.plugins["LiveAudio"][0].type=="audio/basic" && navigator.javaEnabled()) {
document.embeds[0].stop();
setTimeout("document.embeds[0].play(false)",100); }
} else if (document.all) {
ding.Stop();
setTimeout("ding.Run()",100);
}
overMe=1;
} else overMe=0;

writeOnText(idObj, "<span class="+spObj+"><font color='"+clr1+"'>"+tmp0+"</font><font
color='"+clr2+"'>"+tmp1+"</font></span>");
setTimeout("ycrc_com_cn('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+" ,"+plysnd+")",delay);
}
}

function www_ycrc_com_cn() {
ycrc_com_cn(dispStr[0], 0, 'ttl0', 'ttl1', '#339933', '#99FF33', 50, 0);
}
www_ycrc_com_cn();
// -->
</SCRIPT>

20、字符慢慢隐现
说明:字符慢慢隐现
代码:
<body bgcolor="#FFFFFF" id="www_ycrc_com_cn">
<div id="ycrc_com_cn" style="visibility:visible;width:400px;height:30px;text-align:center;
font-family:隶书;font-size:30pt;color:6699ff"></div>

<SCRIPT language="JavaScript">
<!--
var thissize=20
var textfont="隶书"

var textcolor= new Array()
textcolor[0]="000000"
textcolor[1]="000000"
textcolor[2]="000000"
textcolor[3]="111111"
textcolor[4]="222222"
textcolor[5]="333333"
textcolor[6]="444444"
textcolor[7]="555555"
textcolor[8]="666666"
textcolor[9]="777777"
textcolor[10]="888888"
textcolor[11]="999999"
textcolor[12]="aaaaaa"
textcolor[13]="bbbbbb"
textcolor[14]="cccccc"
textcolor[15]="dddddd"
textcolor[16]="eeeeee"
textcolor[17]="ffffff"
textcolor[18]="ffffff"

var message = new Array()
message[0]="欢迎光临盐城人才网"
message[1]="多停留一会儿"
message[2]="你会有更多的收获"
message[3]="请再次光临"
i_message=0

var i_strength=0
var i_message=0
var timer

function www_ycrc_com_cn() {
if(document.all) {
if (i_strength <=17) {
ycrc_com_cn.innerText=message[i_message]
document.all.ycrc_com_cn.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength++
timer=setTimeout("www_ycrc_com_cn()",100)
}
else {
clearTimeout(timer)
setTimeout("dewww_ycrc_com_cn()",1500)
}
}
}

function dewww_ycrc_com_cn() {
if(document.all) {
if (i_strength >=0) {
ycrc_com_cn.innerText=message[i_message]
document.all.ycrc_com_cn.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength--
timer=setTimeout("dewww_ycrc_com_cn()",100)
}
else {
clearTimeout(timer)
i_message++
if (i_message>=message.length) {i_message=0}
i_strength=0
intermezzo()
}
}
}

function intermezzo() {
ycrc_com_cn.innerText=""
setTimeout("www_ycrc_com_cn()",1000)
}
www_ycrc_com_cn();
//-->
</SCRIPT>

21、页面自动滚屏效果
说明:自动滚屏
代码:
<body onLoad="scrollit()">

<SCRIPT language="JavaScript">
<!--
function scrollit(){
for (I=1; I<=500; I++){
self.scroll(1,I)
}
}
//-->
</SCRIPT>

22、文字从天而降
说明:文字从页面顶部掉下来
代码:
<p www_ycrc_com_cn="dropWord" style="position: relative !important; left: 10000 !important" align="center"><font size="3"
color="#ee00FF">很 好 玩 吧 ! 有 没 有 吓 一 跳 ?</font><font size="7" face="Arial" color="#FF0000"><b>YES!</b></font></p>

<SCRIPT language="JavaScript">
<!--
dynamicanimAttr = "www_ycrc_com_cn"
animateElements = new Array()
currentElement = 0
speed = 0
stepsZoom = 8
stepsWord = 8
stepsFly = 12
stepsSpiral = 16
steps = stepsZoom
step = 0
outString = ""
function ycrc_com_cn()
{
var ms = navigator.appVersion.indexOf("MSIE")
ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
if(!ie4)
{
if((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion.substring(0, 1)) >= 4))
{
for (index=document.layers.length-1; index >= 0; index--)
{
layer=document.layers[index]
if (layer.left==10000)
layer.left=0
}
}
return
}
for (index=document.all.length-1; index >= document.body.sourceIndex; index--)
{
el = document.all[index]
animation = el.getAttribute(dynamicanimAttr, false)
if(null != animation)
{
if(animation == "dropWord" || animation == "flyTopRightWord" || animation == "flyBottomRightWord")
{
ih = el.innerHTML
outString = ""
i1 = 0
iend = ih.length
while(true)
{
i2 = startWord(ih, i1)
if(i2 == -1)
i2 = iend
outWord(ih, i1, i2, false, "")
if(i2 == iend)
break
i1 = i2
i2 = endWord(ih, i1)
if(i2 == -1)
i2 = iend
outWord(ih, i1, i2, true, animation)
if(i2 == iend)
break
i1 = i2
}
document.all[index].innerHTML = outString
document.all[index].style.posLeft = 0
document.all[index].setAttribute(dynamicanimAttr, null)
}
if(animation == "zoomIn" || animation == "zoomOut")
{
ih = el.innerHTML
outString = "<SPAN " + dynamicanimAttr + "=\"" + animation + "\" style=\"position: relative; left: 10000;\">"
outString += ih
outString += "</SPAN>"
document.all[index].innerHTML = outString
document.all[index].style.posLeft = 0
document.all[index].setAttribute(dynamicanimAttr, null)
}
}
}
i = 0
for (index=document.body.sourceIndex; index < document.all.length; index++)
{
el = document.all[index]
animation = el.getAttribute(dynamicanimAttr, false)
if (null != animation)
{
if(animation == "flyLeft")
{
el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth
el.style.posTop = 0
}
else if(animation == "flyRight")
{
el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth
el.style.posTop = 0
}
else if(animation == "flyTop" || animation == "dropWord")
{
el.style.posLeft = 0
el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight
}
else if(animation == "flyBottom")
{
el.style.posLeft = 0
el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight
}
else if(animation == "flyTopLeft")
{
el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth
el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight
}
else if(animation == "flyTopRight" || animation == "flyTopRightWord")
{
el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth
el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight
}
else if(animation == "flyBottomLeft")
{
el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth
el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight
}
else if(animation == "flyBottomRight" || animation == "flyBottomRightWord")
{
el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth
el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight
}
else if(animation == "spiral")
{
el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth
el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight
}
else if(animation == "zoomIn")
{
el.style.posLeft = 10000
el.style.posTop = 0
}
else if(animation == "zoomOut")
{
el.style.posLeft = 10000
el.style.posTop = 0
}
else
{
el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth
el.style.posTop = 0
}
el.initLeft = el.style.posLeft
el.initTop = el.style.posTop
animateElements[i++] = el
}
}
window.setTimeout("animate();", speed)
}
function offsetLeft(el)
{
x = el.offsetLeft
for (e = el.offsetParent; e; e = e.offsetParent)
x += e.offsetLeft;
return x
}
function offsetTop(el)
{
y = el.offsetTop
for (e = el.offsetParent; e; e = e.offsetParent)
y += e.offsetTop;
return y
}
function startWord(ih, i)
{
for(tag = false; i < ih.length; i++)
{
c = ih.charAt(i)
if(c == '<')
tag = true
if(!tag)
return i
if(c == '>')
tag = false
}
return -1
}
function endWord(ih, i)
{
nonSpace = false
space = false
while(i < ih.length)
{
c = ih.charAt(i)
if(c != ' ')
nonSpace = true
if(nonSpace && c == ' ')
space = true
if(c == '<')
return i
if(space && c != ' ')
return i
i++
}
return -1
}
function outWord(ih, i1, i2, dyn, anim)
{
if(dyn)
outString += "<SPAN " + dynamicanimAttr + "=\"" + anim + "\" style=\"position: relative; left: 10000;\">"
outString += ih.substring(i1, i2)
if(dyn)
outString += "</SPAN>"
}
function animate()
{
el = animateElements[currentElement]
animation = el.getAttribute(dynamicanimAttr, false)
step++
if(animation == "spiral")
{
steps = stepsSpiral
v = step/steps
rf = 1.0 - v
t = v * 2.0*Math.PI
rx = Math.max(Math.abs(el.initLeft), 200)
ry = Math.max(Math.abs(el.initTop), 200)
el.style.posLeft = Math.ceil(-rf*Math.cos(t)*rx)
el.style.posTop = Math.ceil(-rf*Math.sin(t)*ry)
}
else if(animation == "zoomIn")
{
steps = stepsZoom
el.style.fontSize = Math.ceil(50+50*step/steps) + "%"
el.style.posLeft = 0
}
else if(animation == "zoomOut")
{
steps = stepsZoom
el.style.fontSize = Math.ceil(100+200*(steps-step)/steps) + "%"
el.style.posLeft = 0
}
else
{
steps = stepsFly
if(animation == "dropWord" || animation == "flyTopRightWord" || animation == "flyBottomRightWord")
steps = stepsWord
dl = el.initLeft / steps
dt = el.initTop / steps
el.style.posLeft = el.style.posLeft - dl
el.style.posTop = el.style.posTop - dt
}
if (step >= steps)
{
el.style.posLeft = 0
el.style.posTop = 0
currentElement++
step = 0
}
if(currentElement < animateElements.length)
window.setTimeout("animate();", speed)
}
ycrc_com_cn()
//-->
</SCRIPT>

23、自选背景色(一)
说明:鼠标放到各种颜色代码上,背景色就会相应改变
代码:
<SCRIPT language=javascript>
<!--
function
makeArray(q)
{for(i=1;i<=q;i++){this[i]=0}}Colors=new
makeArray(7);Colors[1]="00";Colors[2]="33";Colors[3]="66";Colors[4]="99";Colors[5]="CC";Colors[6]="FF";
-->
</SCRIPT>
<SCRIPT language=javascript>
<!--
for(i=1;i<=6;i++){for(j=1;j<=6;j++){for(k=1;k<=6;k++){var thiscolor=Colors[i]+Colors[j]+Colors[k];document.writeln("<tr><td
height = 20 align='center' width='200' bgcolor = \"#" + thiscolor + "\" align = right><a href =# ");document.writeln("\'\'
onMouseOver = \"document.bgColor=\'"+thiscolor+"\'\">"+thiscolor+"</a></td></tr>");}}}

-->
</SCRIPT>

24、自选背景色(二)
说明:鼠标放到各种颜色代码上,背景色就会相应改变
代码:
<script language="JavaScript">
<!--
var hex = new Array(6)

hex[0] = "FF"
hex[1] = "CC"
hex[2] = "99"
hex[3] = "66"
hex[4] = "33"
hex[5] = "00"

function display(triplet) {
document.bgColor = '#' + triplet
alert('现在的背景色是 #'+triplet)
}

function drawCell(red, green, blue) {
document.write('<TD BGCOLOR="#' + red + green + blue + '">')
document.write('<A HREF="javascript:display(\'' + (red + green + blue) + '\')">')
document.write('<IMG SRC="place.gif" BORDER=0 HEIGHT=12 WIDTH=12>')
document.write('</A>')
document.write('</TD>')
}

function drawRow(red, blue) {
document.write('<TR>')
for (var i = 0; i < 6; ++i) {
drawCell(red, hex[i], blue)
}
document.write('</TR>')
}

function drawTable(blue) {
document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>')

for (var i = 0; i < 6; ++i) {
drawRow(hex[i], blue)
}
document.write('</TABLE>')
}

function ycrc_com_cn(){
document.write('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=1><TR>')

for (var i = 0; i < 6; ++i) {
document.write('<TD BGCOLOR="#FFFFFF">')
drawTable(hex[i])
document.write('</TD>')
}
document.write('</TR></TABLE>')
}
ycrc_com_cn()
// -->
</script>

25、百页窗效果
说明:进入页面时,页面产生百页窗似的的效果
代码:
<style>
<!--
.ycrc_com_cn{position:absolute;
left:0;
top:0;
layer-background-color:#3399ff;
background-color:#3399ff;
border:0.1px solid green
}
-->
</style>

<div id="i1" class="ycrc_com_cn"></div><div id="i2" class="ycrc_com_cn"></div><div id="i3"
class="ycrc_com_cn"></div><div id="i4" class="ycrc_com_cn"></div><div id="i5" class="ycrc_com_cn"></div><div
id="i6" class="ycrc_com_cn"></div><div id="i7" class="ycrc_com_cn"></div><div id="i8" class="ycrc_com_cn"></div>

<SCRIPT language=javascript>
<!--
var speed=30
var temp=new Array()
var temp2=new Array()
if (document.layers){
for (i=1;i<=8;i++){
temp[i]=eval("document.i"+i+".clip")
temp2[i]=eval("document.i"+i)
temp[i].width=window.innerWidth/8-0.3
temp[i].height=window.innerHeight
temp2[i].left=(i-1)*temp[i].width
}
}
else if (document.all){
var clipbottom=document.body.offsetHeight,cliptop=0
for (i=1;i<=8;i++){
temp[i]=eval("document.all.i"+i+".style")
temp[i].width=document.body.clientWidth/8
temp[i].height=document.body.offsetHeight
temp[i].left=(i-1)*parseInt(temp[i].width)
}
}
function openit(){
window.scrollTo(0,0)
if (document.layers){
for (i=1;i<=8;i=i+2)
temp[i].bottom-=speed
for (i=2;i<=8;i=i+2)
temp[i].top+=speed
if (temp[2].top>window.innerHeight)
clearInterval(stopit)
}
else if (document.all){
clipbottom-=speed
for (i=1;i<=8;i=i+2){
temp[i].clip="rect(0 auto+"+clipbottom+" 0)"
}
cliptop+=speed
for (i=2;i<=8;i=i+2){
temp[i].clip="rect("+cliptop+" auto auto)"
}
if (clipbottom<=0)
clearInterval(stopit)
}
}
function www_ycrc_com_cn(){
stopit=setInterval("openit()",100)
}
www_ycrc_com_cn()

-->


</SCRIPT>

26、舞台光柱照射效果
说明:页面产生舞台光柱照射的效果
代码:
<body bgcolor="#000000" id="www_ycrc_com_cn" style="position: relative; left: 0px; color: White; filter: light">

<script language="VBScript">
Option Explicit
sub window_OnLoad()
call www_ycrc_com_cn.filters.light(0).addambient(0,0,255,30)
call www_ycrc_com_cn.filters.light(0).addcone(400,400,200,100,100,200,204,200,80,10)
end sub

sub document_onMouseMove()
call www_ycrc_com_cn.filters.light(0).MoveLight(1,window.event.x,window.event.y,0,1)
end sub
</script>
鼠标特效

27、滚动的文字说明
说明:鼠标放到链接上就会出现一个说明框,里面有滚动的文字说明
代码:
<a href="http://www.ycrc.com.cn" target="_blank" onMouseOver="ycrc_com_cn_show(this,event,'看到了吧?')"
onMouseOut="ycrc_com_cn_hide()">把鼠标放上来试试</a>
<div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:seashell">
<layer name="nstip" width="1000px" bgColor="seashell"></layer>
</div>
<SCRIPT language="JavaScript">
<!--
if (!document.layers&&!document.all)
event="test"
function ycrc_com_cn_show(current,e,text){

if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid #3399ff">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}

else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function ycrc_com_cn_hide(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}
//-->
</SCRIPT>

28、图片跟随着鼠标
说明:图片跟随着鼠标,最好把图片做成透明的,那样效果更好
代码:
<SCRIPT LANGUAGE="JavaScript">
var image="../images/logo.gif"
var newtop=15
var newleft=15
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}
else
{
layerStyleRef="layer.style.";
layerRef="document.all";
styleSwitch=".style";
}

function ycrc_com_cn() {

layerName = 'iit'

eval('var curElement='+layerRef+'["'+layerName+'"]')
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')
eval('curElement'+styleSwitch+'.visibility="visible"')
eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
eval('height=curElement'+styleSwitch+'.height')
eval('width=curElement'+styleSwitch+'.width')
width=parseInt(width)
height=parseInt(height)
if (event.clientX > (document.body.clientWidth - 5 - width))
{
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
}
else
{
newleft=document.body.scrollLeft + event.clientX
}
eval('curElement'+styleSwitch+'.pixelLeft=newleft')

if (event.clientY > (document.body.clientHeight - 5 - height))
{
newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
}
else
{
newtop=document.body.scrollTop + event.clientY
}
eval('curElement'+styleSwitch+'.pixelTop=newtop')
}

document. = ycrc_com_cn;

if (navigator.appName == "Netscape") {

}
else
{
document.write('<div ID="OuterDiv">')
document.write('<img ID="iit" src="'+image+'" STYLE="position:absolute;TOP:20pt;LEFT:20pt;Z-INDEX:20;visibility:hidden;">')
document.write('</div>')
}
</script>

29、接触链接自动打开窗口
说明:鼠标接触链接后窗口自动打开
代码:
<a href="http://www.ycrc.com.cn" onMouseOver="www_ycrc_com_cn(); return true;">鼠标放上来看看!</a>
<SCRIPT Language="JavaScript">
function www_ycrc_com_cn ()
{
var url="http://www.ycrc.com.cn";

open(url,"NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,w
idth=800,height=600,left=10,top=10");
}
</SCRIPT>

30、鼠标激活警告框
说明:鼠标放到链接上,就立刻弹出警告框
代码:
<a href="" onMouseOver="alert('你好!\n\n本站域名:[url]http://www.ycrc.com.cn[/url]')">试试</a>

31、飘动的字符跟随鼠标
说明:在鼠标后面跟着一串飘动的字符
代码:
<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[i]=-50
}

var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-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_ycrc_com_cn() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=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[i]
thisspan.posTop=ypos[i]
}
}

else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=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[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("www_ycrc_com_cn()",30)
}

for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message[i])
document.write("</span>")
}

if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document. = handlerMM;
www_ycrc_com_cn();
// -->
</script>

32、一群小点跟随鼠标
说明:跟随鼠标的一群小点,就象星星一样
代码:
<div id="tooltip2"
style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:lightyellow">
<layer name="nstip" width="1000px" bgcolor="lightyellow"> </layer>
</div>
<div id="www_ycrc_com_cn__d0"
style="position:absolute; left:10px; top:50px; width:3px; height:3px; z-index:1; background-color: #19636c;
layer-background-color: #19636c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
<div
id="www_ycrc_com_cn__d1"
style="position:absolute; left:20px; top:50px; width:3px; height:3px; z-index:1; background-color: #708574;
layer-background-color: #708574; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
<div
id="www_ycrc_com_cn__d2"
style="position:absolute; left:30px; top:50px; width:3px; height:3px; z-index:1; background-color: #379bbf;
layer-background-color: #379bbf; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
<div
id="www_ycrc_com_cn__d3"
style="position:absolute; left:40px; top:50px; width:3px; height:3px; z-index:1; background-color: #25184c;
layer-background-color: #25184c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
<div
id="www_ycrc_com_cn__d4"
style="position:absolute; left:50px; top:50px; width:3px; height:3px; z-index:1; background-color: #31bd3c;
layer-background-color: #31bd3c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
<div
id="www_ycrc_com_cn__d5"
style="position:absolute; left:60px; top:50px; width:3px; height:3px; z-index:1; background-color: #c11efd;
layer-background-color: #c11efd; border: 1px none #000000; clip: rect(0 3 3 0)"></div>

<script>
if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){

if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}

else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}

function
www_ycrc_com_cn___Layerfx(www_ycrc_com_cn__left,www_ycrc_com_cn__top,www_ycrc_com_cn__fnx,www_ycrc_com_cn__fny,www_ycrc_com_cn__div
,www_ycrc_com_cn__bilder,www_ycrc_com_cn__loop,www_ycrc_com_cn__to,www_ycrc_com_cn__cnt,www_ycrc_com_cn__step) {
if ((document.layers)||(document.all)){
with (Math) {www_ycrc_com_cn__nextx= eval(www_ycrc_com_cn__fnx)}
with (Math) {www_ycrc_com_cn__nexty= eval(www_ycrc_com_cn__fny)}
www_ycrc_com_cn__cnt=(www_ycrc_com_cn__loop &&
www_ycrc_com_cn__cnt>=www_ycrc_com_cn__step*www_ycrc_com_cn__bilder)?0:www_ycrc_com_cn__cnt+www_ycrc_com_cn__step;
if (document.layers){
eval(www_ycrc_com_cn__div+".top="+(www_ycrc_com_cn__nexty+www_ycrc_com_cn__top))
eval(www_ycrc_com_cn__div+".left="+(www_ycrc_com_cn__nextx+www_ycrc_com_cn__left))
}
if (document.all){
eval("www_ycrc_com_cn__div=www_ycrc_com_cn__div.replace(/.layers/gi, '.all')");
eval(www_ycrc_com_cn__div+".style.pixelTop="+(www_ycrc_com_cn__nexty+www_ycrc_com_cn__top));
eval(www_ycrc_com_cn__div+".style.pixelLeft="+(www_ycrc_com_cn__nextx+www_ycrc_com_cn__left));
}
argStr='www_ycrc_com_cn___Layerfx('+www_ycrc_com_cn__left+','+www_ycrc_com_cn__top+',"'+www_ycrc_com_cn__fnx+'","'+www_ycrc_com_cn
__fny+'","'+www_ycrc_com_cn__div+'",'+www_ycrc_com_cn__bilder+','+www_ycrc_com_cn__loop+','+www_ycrc_com_cn__to+','+www_helpor_ne
t__cnt+','+www_ycrc_com_cn__step+')';
if
(www_ycrc_com_cn__cnt<=www_ycrc_com_cn__step*www_ycrc_com_cn__bilder){eval(www_ycrc_com_cn__div+".www_ycrc_com_cn__to=setTimeout(a
rgStr,www_ycrc_com_cn__to)");}
}

}
function www_ycrc_com_cn___Mousetrace(evnt) {
if (www_ycrc_com_cn__ns4)
{if (evnt.pageX) {www_ycrc_com_cn___ml=evnt.pageX; www_ycrc_com_cn___mt=evnt.pageY;} }
else{
www_ycrc_com_cn___ml=(event.clientX + document.body.scrollLeft);
www_ycrc_com_cn___mt=(event.clientY + document.body.scrollTop);
}
if (www_ycrc_com_cn___tracescript)eval(www_ycrc_com_cn___tracescript)
}
var www_ycrc_com_cn__ns4=window.Event?true:false; var www_ycrc_com_cn___mt = 0; var www_ycrc_com_cn___ml = 0;
document. = www_ycrc_com_cn___Mousetrace;
www_ycrc_com_cn___tracescript = '';

if (www_ycrc_com_cn__ns4){ document.captureEvents(Event.MOUSEMOVE);
www_ycrc_com_cn___Mousetrace('',',document.www_ycrc_com_cn___Mousetrace1')}

www_ycrc_com_cn___Layerfx(0,0,'www_ycrc_com_cn___ml+cos((15*sin(www_ycrc_com_cn__cnt/39.83007847812662))+0)*150*(sin(10+www_help
or_net__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','www_ycrc_com_cn___mt+sin((15*sin(www_ycrc_com_cn__cnt/34.224861639800686))+0
)*150*(sin(10+www_ycrc_com_cn__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','document.layers[\'www_ycrc_com_cn__d0\']',2000,true,8
0,0,1);

www_ycrc_com_cn___Layerfx(0,0,'www_ycrc_com_cn___ml+cos((15*sin(www_ycrc_com_cn__cnt/27.66510707209673))+30)*150*(sin(10+www_hel
por_net__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','www_ycrc_com_cn___mt+sin((15*sin(www_ycrc_com_cn__cnt/9.240632767417667))+3
0)*150*(sin(10+www_ycrc_com_cn__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','document.layers[\'www_ycrc_com_cn__d1\']',2000,true,
80,0,1);

www_ycrc_com_cn___Layerfx(0,0,'www_ycrc_com_cn___ml+cos((15*sin(www_ycrc_com_cn__cnt/16.45318944579641))+60)*150*(sin(10+www_hel
por_net__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','www_ycrc_com_cn___mt+sin((15*sin(www_ycrc_com_cn__cnt/16.0564452288292))+60
)*150*(sin(10+www_ycrc_com_cn__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','document.layers[\'www_ycrc_com_cn__d2\']',2000,true,8
0,0,1);

www_ycrc_com_cn___Layerfx(0,0,'www_ycrc_com_cn___ml+cos((15*sin(www_ycrc_com_cn__cnt/6.95348954836835))+90)*150*(sin(10+www_help
or_net__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','www_ycrc_com_cn___mt+sin((15*sin(www_ycrc_com_cn__cnt/44.13697049887155))+90
)*150*(sin(10+www_ycrc_com_cn__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','document.layers[\'www_ycrc_com_cn__d3\']',2000,true,8
0,0,1);

www_ycrc_com_cn___Layerfx(0,0,'www_ycrc_com_cn___ml+cos((15*sin(www_ycrc_com_cn__cnt/33.90077294583733))+120)*150*(sin(10+www_he
lpor_net__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','www_ycrc_com_cn___mt+sin((15*sin(www_ycrc_com_cn__cnt/2.2378828869411587))
+120)*150*(sin(10+www_ycrc_com_cn__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','document.layers[\'www_ycrc_com_cn__d4\']',2000,tr
ue,80,0,1);

www_ycrc_com_cn___Layerfx(0,0,'www_ycrc_com_cn___ml+cos((15*sin(www_ycrc_com_cn__cnt/37.858312521039835))+150)*150*(sin(10+www_h
elpor_net__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','www_ycrc_com_cn___mt+sin((15*sin(www_ycrc_com_cn__cnt/18.083839795990098)
)+150)*150*(sin(10+www_ycrc_com_cn__cnt/20)+0.2)*cos(www_ycrc_com_cn__cnt/20)','document.layers[\'www_ycrc_com_cn__d5\']',2000,t
rue,80,0,1);

if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){

if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}

else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}

function
www_ycrc_com_cn___Layerfx(www_ycrc_com_cn__left,www_ycrc_com_cn__top,www_ycrc_com_cn__fnx,www_ycrc_com_cn__fny,www_ycrc_com_cn__div
,www_ycrc_com_cn__bilder,www_ycrc_com_cn__loop,www_ycrc_com_cn__to,www_ycrc_com_cn__cnt,www_ycrc_com_cn__step) {
if ((document.layers)||(document.all)){
with (Math) {www_ycrc_com_cn__nextx= eval(www_ycrc_com_cn__fnx)}
with (Math) {www_ycrc_com_cn__nexty= eval(www_ycrc_com_cn__fny)}
www_ycrc_com_cn__cnt=(www_ycrc_com_cn__loop &&
www_ycrc_com_cn__cnt>=www_ycrc_com_cn__step*www_ycrc_com_cn__bilder)?0:www_ycrc_com_cn__cnt+www_ycrc_com_cn__step;
if (document.layers){
eval(www_ycrc_com_cn__div+".top="+(www_ycrc_com_cn__nexty+www_ycrc_com_cn__top))
eval(www_ycrc_com_cn__div+".left="+(www_ycrc_com_cn__nextx+www_ycrc_com_cn__left))
}
if (document.all){
eval("www_ycrc_com_cn__div=www_ycrc_com_cn__div.replace(/.layers/gi, '.all')");
eval(www_ycrc_com_cn__div+".style.pixelTop="+(www_ycrc_com_cn__nexty+www_ycrc_com_cn__top));
eval(www_ycrc_com_cn__div+".style.pixelLeft="+(www_ycrc_com_cn__nextx+www_ycrc_com_cn__left));
}
argStr='www_ycrc_com_cn___Layerfx('+www_ycrc_com_cn__left+','+www_ycrc_com_cn__top+',"'+www_ycrc_com_cn__fnx+'","'+www_ycrc_com_cn
__fny+'","'+www_ycrc_com_cn__div+'",'+www_ycrc_com_cn__bilder+','+www_ycrc_com_cn__loop+','+www_ycrc_com_cn__to+','+www_helpor_ne
t__cnt+','+www_ycrc_com_cn__step+')';
if
(www_ycrc_com_cn__cnt<=www_ycrc_com_cn__step*www_ycrc_com_cn__bilder){eval(www_ycrc_com_cn__div+".www_ycrc_com_cn__to=setTimeout(a
rgStr,www_ycrc_com_cn__to)");}
}

}
function www_ycrc_com_cn___Mousetrace(evnt) {
if (www_ycrc_com_cn__ns4)
{if (evnt.pageX) {www_ycrc_com_cn___ml=evnt.pageX; www_ycrc_com_cn___mt=evnt.pageY;} }
else{
www_ycrc_com_cn___ml=(event.clientX + document.body.scrollLeft);
www_ycrc_com_cn___mt=(event.clientY + document.body.scrollTop);
}
if (www_ycrc_com_cn___tracescript)eval(www_ycrc_com_cn___tracescript)
}
</script>

33、右键打开收藏夹
说明:点击鼠标右键,收藏夹就会自动打开,也等于是禁止了右键
代码:
<script language="JavaScript1.2">
if (document.all)
document.body. Function("if
(event.button==2||event.button==3)window.external.addFavorite('http://www.ycrc.com.cn','盐城人才网')")
</script>

34、右键自动重定向
说明:禁止使用鼠标右键,如果你点了右键页面就自动跳转到相应链接上
代码:
<script language="JavaScript">

url="http://www.ycrc.com.cn";

if (navigator.appName.indexOf("Internet Explorer") != -1)
document. = www_ycrc_com_cn;

function www_ycrc_com_cn()
{
if (event.button == 2 | event.button == 3)
{
alert("去盐城人才网看看!");
location.replace(url);
}
}
</script>

35、屏蔽鼠标左、右键
说明:把鼠标的左右键都屏蔽掉,点击之后无任何反应。别说点击右键不会出现菜单,就连按住左键拖动想选中文本都不行!
代码:
修改<body>标签,加入onContextMenu="return false" onSelectStart="return false"。

例如,把<body bgColor="#FFFFFF">改为<body bgColor="#FFFFFF" onContextMenu="return false" onSelectStart="return false">
 
时间日期

36、数字时钟
说明:数字化的时钟
代码:
<span id="liveclock" style"=width: 109px; height: 15px"></span>
<SCRIPT language=javascript>
function www_ycrc_com_cn()
{
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()

if(minutes<=9)
minutes="0"+minutes
if(seconds<=9)
seconds="0"+seconds
myclock="现在时刻:<font size='5' face='Arial black'>"+hours+":"+minutes+":"+seconds+"</font>"
if(document.layers){document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}else if(document.all)
liveclock.innerHTML=myclock
setTimeout("www_ycrc_com_cn()",1000)
}
www_ycrc_com_cn();
//-->
</SCRIPT>

37、六种风格的时间
说明:六种风格时间显示,一定有你喜欢的!
代码:
<SCRIPT language="javascript">
<!--
function initArray()
{
for(i=0;i<initArray.arguments.length;i++)
this[i]=initArray.arguments[i];
}
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()+"日,"+ge
tFullYear(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()+"日,"+ge
tFullYear(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>

38、显示停留的时间
说明:显示他人在页面停留的时间,而且可以作出提醒
代码:
您在本站逗留了<input type="text" name="ycrc_com_cn" size="15" style="border: 0 ">
<SCRIPT language="javascript">
<!--
var sec=0;
var min=0;
var hou=0;
flag=0;
idt=window.setTimeout("www_ycrc_com_cn();",1000);
function www_ycrc_com_cn()
{
sec++;
if(sec==60){sec=0;min+=1;}
if(min==60){min=0;hou+=1;}
if((min>0)&&(flag==0))
{
window.alert("您刚刚来了1分钟!可别急着走开,还有好多好东东等着您呢!--站长");
flag=1;
}
ycrc_com_cn.value=hou+"小时"+min+"分"+sec+"秒";
idt=window.setTimeout("www_ycrc_com_cn();",1000);
}
//-->

</SCRIPT>

39、有影子的数字时钟
说明:这个时钟是有影子的,而且还在不停地走着呢
代码:
<div id="bgclockshade" style="position:absolute;visibility:visible;font-family:'Arial
black';color:#cccccc;font-size:20px;top:50px;left:173px"></div>
<div id="bgclocknoshade" style="position:absolute;visibility:visible;font-family:'Arial
black';color:#000000;font-size:20px;top:48px;left:170px"></div>
<div id="mainbody" style="position:absolute; visibility:visible">
</div>
<script language=javaScript>
<!--
function www_ycrc_com_cn() {
thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
thistime = hours+":"+minutes+":"+seconds

if(document.all) {
bgclocknoshade.innerHTML=thistime
bgclockshade.innerHTML=thistime
}

if(document.layers) {
document.bgclockshade.document.write('<div id="bgclockshade"
style="position:absolute;visibility:visible;font-family:Verdana;color:FFAAAAA;font-size:20px;top:10px;left:152px">'+thistime+
'</div>')
document.bgclocknoshade.document.write('<div id="bgclocknoshade"
style="position:absolute;visibility:visible;font-family:Verdana;color:DDDDDD;font-size:20px;top:8px;left:150px">'+thistime+'<
/div>')
document.close()
}
var timer=setTimeout("www_ycrc_com_cn()",200)
}
www_ycrc_com_cn();
//-->
</script>

40、全中文日期显示
说明:年月日都是用全中文显示
代码:
<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>
状态特效

41、打字效果
说明:文字在状态栏上从左往右一个一个地显示,就象你打出的字一样
代码:
<script language="JavaScript">
var msg = "欢迎来到盐城人才网,请多提意见。谢谢! " ;
var interval = 120
var spacelen = 120;
var space10=" ";
var seq=0;
function ycrc_com_cn() {
len = msg.length;
window.status = msg.substring(0, seq+1);
seq++;
if ( seq >= len ) {
seq = 0;
window.status = '';
window.setTimeout("ycrc_com_cn();", interval );
}
else
window.setTimeout("ycrc_com_cn();", interval );
}
ycrc_com_cn();
</script>

42、文字从右往左移动
说明:文字在状态栏上从右往左显示,而且是循环的
代码:
<script>
<!--
function ycrc_com_cn(seed)
{ var m1 = "欢迎来到盐城人才网,请多提意见。谢谢! !" ;
var m2 = "" ;
var msg=m1+m2;
var out = " ";
var c = 1;
var speed = 120;
if (seed > 100)
{ seed-=2;
var cmd="ycrc_com_cn(" + seed + ")";
timerTwo=window.setTimeout(cmd,speed);}
else if (seed <= 100 && seed > 0)
{ for (c=0 ; c < seed ; c++)
{ out+=" ";}
out+=msg; seed-=2;
var cmd="ycrc_com_cn(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,speed); }
else if (seed <= 0)
{ if (-seed < msg.length)
{
out+=msg.substring(-seed,msg.length);
seed-=2;
var cmd="ycrc_com_cn(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,speed);}
else { window.status=" ";
timerTwo=window.setTimeout("ycrc_com_cn(100)",speed);
}
}
}
ycrc_com_cn(100);
-->
</script>

43、文字不停闪烁
说明:一段文字在状态栏上不停跳动显示,可以作为提示信息
代码:
<script language="">
<!--
var yourwords = "欢迎来到盐城人才网,请多提意见。谢谢! ";
var speed = 700;
var control = 1;
function ycrc_com_cn()
{
if (control == 1)
{
window.status=yourwords;
control=0;
}
else
{
window.status="";
control=1;
}
setTimeout("ycrc_com_cn()",speed);
}
ycrc_com_cn()
// -->
</script>

44、打字之后移动消失
说明:文字在状态栏上来回频繁地出现,而且速度很快
代码:
<SCRIPT LANGUAGE="JavaScript">
<!--
var Message="欢迎来到盐城人才网,请多提意见。谢谢! ";
var place=1;
function scrollIn() {
window.status=Message.substring(0, place);
if (place >= Message.length) {
place=1;
window.setTimeout("ycrc_com_cn()",300);
} else {
place++;
window.setTimeout("scrollIn()",50);
}
}
function ycrc_com_cn() {
window.status=Message.substring(place, Message.length);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollIn()", 100);
} else {
place++;
window.setTimeout("ycrc_com_cn()", 50);
}
}
ycrc_com_cn();
-->
</SCRIPT>

45、鼠标接触链接后状态栏出现特效提示特效
说明:鼠标放到链接上时,状态栏上文字先出现特殊效果,然后再出现文字
代码:
<a href="http://www.ycrc.com.cn" onMouseOver="ycrc_com_cn_In('盐城人才网. [[url]http://www.ycrc.com.cn[/url]]');return true;"
onMouseOut="ycrc_com_cn_Out();">试试看</a>
<SCRIPT LANGUAGE="JavaScript">
<!--
var data = "0123456789";
var done = 1;
function ycrc_com_cn_In(text) {
decrypt(text, 2, 1);
}

function ycrc_com_cn_Out() {
self.status = '';
done = 1;
}

function decrypt(text, max, delay) {
if (done) {
done = 0;
decrypt_helper(text, max, delay, 0, max);
}
}
function decrypt_helper(text, runs_left, delay, charvar, max) {
if (!done) {
runs_left = runs_left - 1;
var status = text.substring(0, charvar);
for (var current_char = charvar; current_char < text.length; current_char++) {
status += data.charAt(Math.round(Math.random()*data.length));
}
window.status = status;
var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"
var new_char = charvar + 1;
var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"
if(runs_left > 0) {
setTimeout(rerun, delay);
}
else {
if (charvar < text.length) {
setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));
}
else {
done = 1;
}
}
}
}
//-->
</SCRIPT>

46、输入文字,然后在状态栏里显示
说明:在输入框中输入什么,就会在状态栏显示什么,而且是特效显示
代码:
<form name="shooterform" method="get">
<input type="text" name="shoot_text" size="20" style="border: 1 solid #0099FF"> <input type="button" name="trigger"value="看
看" onclick="doShoot(shoot_text.value)" style="color: #FFFFFF; background-color: #0099FF; border: 1 solid #0099FF" border=0>
<input type="reset" value="重写" name="B1" style="color: #FFFFFF; background-color: #0099FF; border: 1 solid #0099FF"
border=0> </p>
</form>

<script LANGUAGE="JavaScript">
var text = "在输入栏里您输入什么我就能显示什么!!!";
var total_length = 60; // length of string+spaces

function doShoot(msg) {
var status_message = "";
var assembling = "";
this.status = status_message;
var index = 0;
var location = 0, i;
// now shoot one letter at a time
for(i=0; i < msg.length; i++) { // moves through the message
for(j=total_length-status_message.length; j > -1;j--) {
// see how many spaces have to be added
assembling = "";
for(var k=0; k < j; k++)
assembling += " ";
assembling += msg.charAt(i);
this.status=status_message +assembling;
}
status_message += assembling;
}
}
</script>
图像特效

47、图象大小自动变化
说明:把一张图片变形扭曲成各种不同的长宽,非常好玩
代码:
<img src="http://www.ycrc.com.cn/images/logo.gif" name="u" border="1" alt="很好玩的">
<script language="JavaScript">

var b = 1;
var c = true;

function www_ycrc_com_cn(){
if(document.all);

if(c == true) {
b++;
}
if(b==100) {
b--;
c = false
}

if(b==10) {
b++;
c = true;
}

if(c == false) {
b--;
}
u.width=150 + b;
u.height=125 - b;
setTimeout("www_ycrc_com_cn()",50);
}
www_ycrc_com_cn();
</script>

48、漫天飞雪
说明:漫天飞雪
代码:
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
var no = 12;
var speed = 10;
var heart = "http://www.ycrc.com.cn/images/snow.gif";
var flag;
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;

var dx, xp, yp;
var am, stx, sty;
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;
}
dx = new Array();
xp = new Array();
yp = new Array();
amx = new Array();
amy = new Array();
stx = new Array();
sty = new Array();
flag = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-30)+10;
yp[i] = Math.random()*doc_height;
amy[i] = 12+ Math.random()*20;
amx[i] = 10+ Math.random()*40;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
flag[i] = (Math.random()>0.5)?1:0;
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(heart+ "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(heart+ "\" border=\"0\"></layer>");
}
} else
if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(heart+ "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(heart+ "\" border=\"0\"></div>");
}
}
}

function ycrc_com_cn() {
for (i = 0; i < no; ++ i) {
if (yp[i] > doc_height-50) {
xp[i] = 10+ Math.random()*(doc_width-amx[i]-30);
yp[i] = 0;
flag[i]=(Math.random()<0.5)?1:0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
if (flag[i])
dx[i] += stx[i];
else
dx[i] -= stx[i];
if (Math.abs(dx[i]) > Math.PI) {
yp[i]+=Math.abs(amy[i]*dx[i]);
xp[i]+=amx[i]*dx[i];
dx[i]=0;
flag[i]=!flag[i];
}
document.layers["dot"+i].top = yp[i] + amy[i]*(Math.abs(Math.sin(dx[i])+dx[i]));
document.layers["dot"+i].left = xp[i] + amx[i]*dx[i];

}
setTimeout("ycrc_com_cn()", speed);
}

function www_ycrc_com_cn() {
for (i = 0; i < no; ++ i) {
if (yp[i] > doc_height-50) {
xp[i] = 10+ Math.random()*(doc_width-amx[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
flag[i]=(Math.random()<0.5)?1:0;
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
if (flag[i])
dx[i] += stx[i];
else
dx[i] -= stx[i];
if (Math.abs(dx[i]) > Math.PI) {
yp[i]+=Math.abs(amy[i]*dx[i]);
xp[i]+=amx[i]*dx[i];
dx[i]=0;
flag[i]=!flag[i];
}

document.all["dot"+i].style.pixelTop = yp[i] + amy[i]*(Math.abs(Math.sin(dx[i])+dx[i]));
document.all["dot"+i].style.pixelLeft = xp[i] + amx[i]*dx[i];
}
setTimeout("www_ycrc_com_cn()", speed);
}

if (ns4up) {
ycrc_com_cn();
} else if (ie4up) {
www_ycrc_com_cn();
}
//-->
</script>

49、图片渐渐显隐
说明:图片渐渐显隐
代码:
<img src="http://www.ycrc.com.cn/images/swimming.gif" name="u" border="1" style="filter:alpha(opacity=0)">
<script language="JavaScript">

var b = 1;
var c = true;

function ycrc_com_cn(){
if(document.all);

if(c == true) {
b++;
}
if(b==100) {
b--;
c = false
}

if(b==10) {
b++;
c = true;
}

if(c == false) {
b--;
}
u.filters.alpha.opacity=0 + b;
setTimeout("ycrc_com_cn()",50);
}
ycrc_com_cn();
</script>

50、图片渐渐显示
说明:图片渐渐显示
代码:
<img src="http://www.ycrc.com.cn/images/swimming.gif" border="1" id="ycrc_com_cn" style="visibility:hidden;
FILTER:revealTrans(Duration=4.0, Transition=23);">
<SCRIPT FOR="window" EVENT="onLoad" LANGUAGE="vbscript">
ycrc_com_cn.filters.item(0).apply()
ycrc_com_cn.filters.item(0).transition = 12
ycrc_com_cn.Style.visibility = ""
ycrc_com_cn.filters(0).play(2.0)
</SCRIPT>

51、自由移动的图片(一)
说明:自由移动的图片
代码:
<div id="ycrc_com_cn" style="position:absolute; visibility:visible; left:0px; top:0px; z-index:-1">
<img src="http://code.ycrc.com.cn/picture/swimming.gif" border="0">
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
var _all = '';
var _style = '';
var wwidth, wheight;
var ydir = '++';
var xdir = '++';
var id1, id2, id3;
var x = 1;
var y = 1;
var x1, y1;
if(!isNS) {
_all='all.';
_style='.style';
}
function www_ycrc_com_cn() {
clearTimeout(id1);
clearTimeout(id2);
clearTimeout(id3);
if (isNS) {
wwidth = window.innerWidth - 55;
wheight = window.innerHeight - 50;
} else {
wwidth = document.body.clientWidth - 55;
wheight = document.body.clientHeight - 50;
}
id3 = setTimeout('randomdir()', 20000);
animate();
}
function randomdir() {
if (Math.floor(Math.random()*2)) {
(Math.floor(Math.random()*2)) ? xdir='--': xdir='++';
} else {
(Math.floor(Math.random()*2)) ? ydir='--': ydir='++';
}
id2 = setTimeout('randomdir()', 20000);
}
function animate() {
eval('x'+xdir);
eval('y'+ydir);
if (isNS) {
ycrc_com_cn.moveTo((x+pageXOffset),(y+pageYOffset))
} else {
ycrc_com_cn.pixelLeft = x+document.body.scrollLeft;
ycrc_com_cn.pixelTop = y+document.body.scrollTop;
}
if (isNS) {
if (ycrc_com_cn.top <= 5+pageYOffset) ydir = '++';
if (ycrc_com_cn.top >= wheight+pageYOffset) ydir = '--';
if (ycrc_com_cn.left >= wwidth+pageXOffset) xdir = '--';
if (ycrc_com_cn.left <= 5+pageXOffset) xdir = '++';
} else {
if (ycrc_com_cn.pixelTop <= 5+document.body.scrollTop) ydir = '++';
if (ycrc_com_cn.pixelTop >= wheight+document.body.scrollTop) ydir = '--';
if (ycrc_com_cn.pixelLeft >= wwidth+document.body.scrollLeft) xdir = '--';
if (ycrc_com_cn.pixelLeft <= 5+document.body.scrollLeft) xdir = '++';
}
id1 = setTimeout('animate()', 30);
}
var ycrc_com_cn=eval('document.'+_all+'ycrc_com_cn'+_style);
// -->
</script>

再把<body>改为:
<body OnLoad="www_ycrc_com_cn()" OnResize="www_ycrc_com_cn()">

52、自由移动的图片(二)
说明:图片在页面内随意飘动,遇到边界还会反弹。
代码:
<div id="img" style="position:absolute;">
<a href="http://www.ycrc.com.cn" target="_blank">
<img src="http://www.ycrc.com.cn/images/swimming.gif" border="0"></a>
</div>

<SCRIPT LANGUAGE="JavaScript">
<!--
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = yPos;
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}
function www_ycrc_com_cn() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
www_ycrc_com_cn();
//For more,visit:[url]www.ycrc.com.cn[/url]
-->
</script>

53、图片大小随鼠标触碰而变化
说明:鼠标接触或者离开图片时,图片大小会相应变化
代码:
<span id="s1" style = "width : 150"><a href="http://www.ycrc.com.cn" target="_blank"
onmouseover="www_ycrc_com_cn.style.width='200';" onmouseout="www_ycrc_com_cn.style.width= '150';"><Img
src="http://www.ycrc.com.cn/images/swimming.gif" id="www_ycrc_com_cn"></a></span>
 
cookie

54、记录登陆次数
说明:记录访客的来访次数,并根据作出不同的提示信息
代码:
<SCRIPT language="JavaScript">
<!--
function www_ycrc_com_cn(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_ycrc_com_cn(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":"");
}

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("<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>

55、自动关闭弹出式窗口
说明:跟随页面弹出的窗口在规定时间内自动关闭,而且不作任何提示
代码:
<script language="JavaScript">
<!--
url="popup.htm"
window.open(url, 'www_ycrc_com_cn', '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>


56、只弹出一次窗口
说明:窗口只在第一次访问时弹出
代码:
<SCRIPT language="JavaScript">
<!--
function openpopup(){
url="popup.htm"
window.open(url,"www_ycrc_com_cn","width=468,height=60,left=200,top=50")
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function ycrc_com_cn(){
if (get_cookie('popped')==''){
openpopup()
document.cookie="popped=yes"
}
}
ycrc_com_cn()
//-->
</SCRIPT>

57、记录页面更新时间
说明:自动记录、显示页面更新时间
代码:
<script language="JavaScript">
<!--
document.write("本页最后更新日期: " + document.lastModified)
-->
</script>


58、显示屏幕分辨率
说明:显示访客的屏幕分辨率
代码:
<script language="JavaScript">
document.write("我猜,你的屏幕分辨率是"+screen.width+"x"+screen.height+",对不对?")
-->
</script>

59、显示浏览器名
说明:显示访客的浏览器类型
代码:
<script language="JavaScript">
document.write("我猜,你的浏览器是"+navigator.appName+",对不对?")
-->
</script>

60、显示系统信息
说明:显示访客的系统信息
代码:
<script language="JavaScript">
document.write("我猜,你的系统是:<br>"+navigator.userAgent+",<br>对不对?")
-->
</script>
其它特效

61、给页面加热键
说明:给页面加一个热键,按了它后就自动转到相应页面
代码:
<SCRIPT language="JavaScript">
<!--
var hotkey=97
var destination="http://www.ycrc.com.cn";
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function ycrc_com_cn(e){
if (document.layers){
if (e.which==hotkey)
window.location=destination;
}
else if (document.all){
if (event.keyCode==hotkey)
window.location=destination;
}
}
document.onkeypress=ycrc_com_cn;
//-->
</SCRIPT>

62、javascript的容错脚本
说明:javascript的容错脚本,有了它,你的页面就不会出现错误提示了。
代码:
<SCRIPT LANGUAGE="JavaScript">
<!--
function ycrc_com_cn()
{
return true;
}
window.onerror = ycrc_com_cn;
-->
</SCRIPT>

63、在页面内登录FTP
说明:用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 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>

64、彩色滚动条
说明:使你的滚动条变成彩色!(IE5.5以下版本无效)
代码:
把以下代码加入到<head>与</head>之间:
<style type="text/css">
body
{
scrollbar-face-color: #b5daff;
scrollbar-highlight-color: #ffffff;
scrollbar-shadow-color: #000000;
scrollbar-arrow-color: #0000ff;
scrollbar-base-color: #6699ff;
scrollbar-dark-shadow-color: #6699ff;
}
</style>

你可能感兴趣的:(职场,网页,特效,休闲)