| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 6152 人关注过本帖
标题:无聊找了点网页特效代码!!
只看楼主 加入收藏
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
 问题点数:0 回复次数:50 
无聊找了点网页特效代码!!

右键菜单
加在<body>与</body>之间
<OBJECT id=menu type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM name="Command" value="Related Topics,menu">
<PARAM name="Item1" value="动易;http://www.aspease.com">
<PARAM name="Item2" value="搜狐;http://www.sohu.com">
<PARAM name="Item3" value="新浪;http://www.sina.com">
<PARAM name="Item4" value="网易;http://www.163.com">
<PARAM name="Item5" value="互动学院;http://favorites.myrice.com">
</OBJECT> <script> if (document.all) document.body.onmousedown=new Function("if (event.button==2) menu.Click();") </script>

搜索更多相关主题的帖子: 网页特效 代码 
2006-04-25 12:38
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

<!--网页加载时图片_波动-->
<html>

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

<title>ASPEASE</title>
<script language="JavaScript" fptype="dynamicanimation">
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language="JavaScript1.2" fptype="dynamicanimation">
<!--
// See KB article about changing this dynamic HTML
dynamicanimAttr = "dynamicanimation"
animCancel = "skipanim"
fpanimationPrefix = "fpAnim"
animateElements = new Array()
currentElement = 0
speed = 1
stepsZoom = 8
stepsWord = 8
stepsFly = 17
stepsSpiral = 16
stepsSpiralWord = 19
stepsElastic = 32
steps = stepsZoom
step = 0
cornerPhase=0
outEffect=0
function remSuffix(str)
{
ind=str.indexOf("FP")
str = str.substring(0,ind)
return str
}
function dynAnimOut(el)
{
outEffect=1
dynAnimation(el)
outEffect=0
}
function dynAnimation(obj)
{
animateElements = new Array()
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))
doc_els=document.layers
else
return
}
else
doc_els=document.all
if(outEffect && !ie4)
return
if(ie4)
{
for (index=document.all.length-1; index >= document.body.sourceIndex; index--)
{
el = document.all[index]
if(outEffect && el != obj)
continue
if(outEffect)
animationId = el.id.substring(9,el.id.length)
else
animationId = el.id.substring(6,el.id.length)
animation=remSuffix(animationId)
if(null != animation)
{
altcnt=0
if( animation == "dropWord" ||
animation == "flyTopRightWord" ||
animation == "flyBottomRightWord" ||
animation == "waveWords" ||
animation == "hopWords")
{
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, "", outEffect ? obj.id : el.id)
if(i2 == iend)
break
i1 = i2
i2 = endWord(ih, i1)
if(i2 == -1)
i2 = iend
if (animation == "waveWords")
outWordAlt(ih, i1, i2, true, animation, altcnt)
else
outWord(ih, i1, i2, true, (outEffect ? "Out" : "") + animation,
outEffect ? obj.id : el.id)

if(i2 == iend)
break
i1 = i2
altcnt++
}
document.all[index].innerHTML = outString
document.all[index].style.posLeft = 0
document.all[index].setAttribute(animCancel, true)
document.all[index].style.visibility="visible"
}
}
}
}
i = 0
for (index=0; index < doc_els.length; index++)
{
el = doc_els[index]
if(0 != el.id.indexOf(fpanimationPrefix))
continue
if (ie4)
{
elprops=el.style
scrollOffsetTop=document.body.scrollTop
docHeight=document.body.offsetHeight
docWidth=document.body.offsetWidth
elW=100
elH=el.offsetHeight
}
else
{
elprops=el
scrollOffsetTop=window.pageYOffset
docHeight=window.innerHeight
docWidth=window.innerWidth
elW=el.clip.width
elH=el.clip.height
}
if(outEffect)
animationId = el.id.substring(9,el.id.length)
else
animationId = el.id.substring(6,el.id.length)
animation=remSuffix(animationId)
if(outEffect && (obj != el))
{
if(el.SRCID != obj.id)
continue
}
if (null != animation )
{
if(ie4 && null!=el.getAttribute(animCancel, false))
continue
if(!ie4)
{
elprops.posLeft=elprops.left
elprops.posTop=elprops.top
}
el.startL=offsetLeft(el)
if(animation == "flyLeft")
{
elprops.posLeft = -offsetLeft(el)-elW
elprops.posTop = 0
}
else if(animation == "flyRight" || animation=="elasticRight")
{
elprops.posLeft = -offsetLeft(el)+docWidth
elprops.posTop = 0
}
else if(animation == "flyTop" || animation == "dropWord")
{
elprops.posLeft = 0
elprops.posTop = scrollOffsetTop-offsetTop(el)-elH
}
else if(animation == "flyBottom" || animation == "elasticBottom")
{
elprops.posLeft = 0
elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
}
else if(animation == "flyTopLeft")
{
elprops.posLeft = -offsetLeft(el)-elW
elprops.posTop = scrollOffsetTop-offsetTop(el)-elH
}
else if(animation == "flyTopRight" || animation == "flyTopRightWord")
{
elprops.posLeft = -offsetLeft(el)+docWidth
elprops.posTop = scrollOffsetTop-offsetTop(el)-elH
}
else if(animation == "flyCorner")
{
elprops.posLeft = docWidth*0.2-offsetLeft(el)

elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
}
else if(animation == "flyBottomLeft")
{
elprops.posLeft = -offsetLeft(el)-elW
elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
}
else if(animation == "flyBottomRight" || animation == "flyBottomRightWord")
{
elprops.posLeft = -offsetLeft(el)+docWidth
elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
}
else if(animation == "spiral")
{
elprops.posLeft = -offsetLeft(el)+docWidth
elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight
}
else if((animation.indexOf("waveWords") != -1) || animation=="hopWords")
{
if(i)
{
prevEl=animateElements[i-1]
elprops.r = offsetLeft(el)-prevEl.startL
}
else
elprops.r = offsetLeft(el)
}
else if(animation == "wipeLR" || animation == "wipeMID")
{
if (ie4 && elprops.position=="absolute")
{
el.sizeW=el.offsetWidth
elprops.clip="rect(0 0 0 0)"
}
else if (!ie4)
{
el.sizeW=el.clip.width
el.clip.width=0
}
}
else if(animation == "wipeTB")
{
if (ie4 && elprops.position=="absolute")
{
elprops.clip="rect(0 0 0 0)"
}
else if(!ie4)
{
el.sizeH=el.clip.height
el.clip.height=0
}
}
else if(animation == "zoomIn")
{
elprops.posLeft = 0
elprops.posTop = 0
}
else if(animation == "zoomOut")
{
elprops.posLeft = 0
elprops.posTop = 0
}
else
{
continue
}
if(!outEffect)
{
el.initLeft = elprops.posLeft
el.initTop = elprops.posTop
el.endLeft = 0
el.endTop = 0
elprops.visibility = "hidden"
}
else
{
el.initLeft = 0
el.initTop = 0
el.endLeft = elprops.posLeft
el.endTop = elprops.posTop
elprops.posTop = 0
elprops.posLeft = 0
}
if(!ie4)
{
elprops.left=elprops.initLeft
elprops.top =elprops.initTop
}
animateElements[i++] = el
}
}
if(animateElements.length > 0)
{
if(outEffect)
window.setTimeout("animate(1);", speed, "Javascript")
else
window.setTimeout("animate(0);", speed, "Javascript")
}
}
function offsetLeft(el)
{
if(ie4)
{
x = el.offsetLeft
for (e = el.offsetParent; e; e = e.offsetParent)
x += e.offsetLeft
return x
}
else
{
x = el.pageX
return x
}
}
function offsetTop(el)
{
if(ie4)
{
y = el.offsetTop
for (e = el.offsetParent; e; e = e.offsetParent)
y += e.offsetTop;
return y
}
else
{
y = el.pageY
return y
}
}
function startWord(ih, i)
{
for(tag = false; i < ih.length; i++)
{
c = ih.charAt(i)
if(c == '<')
{
if(ih.substring(i+1, i+4) == "IMG")
return i;
tag = true
}
if(!tag)
return i
if(c == '>')
tag = false
}
return -1
}
function endWord(ih, i)
{
nonSpace = false
space = false
img = false
if(ih.charAt(i) == '<')
{
img = true
i++;
}
while(i < ih.length)
{
c = ih.charAt(i)
if(c != ' ')
nonSpace = true
if(img && c == '>')
img = false;
if(nonSpace && !img && c == ' ')
space = true
if(c == '<')
return i
if(space && c != ' ')
return i
i++
}
return -1
}
function outWord(ih, i1, i2, dyn, anim, srcID)
{
if(dyn)
if(!outEffect)
outString += "<SPAN ID=\"" + fpanimationPrefix + anim + "FP\" style=\"position: relative; visibility: hidden;\">"
else
outString += "<SPAN SRCID=\"" + srcID + "\"ID=\"" + fpanimationPrefix + anim + "FP\" style=\"position: relative;\">"
outString += ih.substring(i1, i2)
if(dyn)
outString += "</SPAN>"
}
function outWordAlt(ih, i1, i2, dyn, anim, altcnt)
{
if(dyn)
{
if(altcnt%2)
outString += "<SPAN ID=\"" + fpanimationPrefix + anim + "LFP\" style=\"position: relative; visibility: hidden;\">"
else
outString += "<SPAN ID=\"" + fpanimationPrefix + anim + "RFP\" style=\"position: relative; visibility: hidden;\">"
}

outString += ih.substring(i1, i2)
if(dyn)
outString += "</SPAN>"
}
function animate(animOut)
{
el = animateElements[currentElement]
if(animOut)
animationId = el.id.substring(9,el.id.length);
else
animationId = el.id.substring(6,el.id.length);
animation=remSuffix(animationId)
if (ie4)
elprops=el.style
else
elprops=el

if(!step && !animOut)
elprops.visibility="visible"
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)
elprops.posLeft = Math.ceil(-rf*Math.cos(t)*rx)
elprops.posTop = Math.ceil(-rf*Math.sin(t)*ry)
}
else if(animation == "waveWordsL" || animation=="hopWords" || animation == "waveWords")
{
steps = stepsSpiralWord
v = step/steps
rf = (1.0 - v)
t = v * 1.0*Math.PI
elprops.posLeft = Math.ceil(-rf*Math.cos(t)*elprops.r)
elprops.posTop = Math.ceil(-rf*Math.sin(t)*elprops.r)
}
else if(animation == "waveWordsR")
{
steps = stepsSpiralWord
v = step/steps
rf = (1.0 - v)
t = v * 1.0*Math.PI
elprops.posLeft = Math.ceil(-rf*Math.cos(t)*elprops.r)
elprops.posTop = Math.ceil( rf*Math.sin(t)*elprops.r)
}
else if(animation == "zoomIn")
{
steps = stepsZoom
elprops.fontSize = Math.ceil(50+50*step/steps) + "%"
elprops.posLeft = 0
}
else if(animation == "zoomOut")
{
steps = stepsZoom
fontSz=Math.ceil(100+200*(steps-step)/steps) + "%"
elprops.fontSize = fontSz
elprops.posLeft = 0
}
else if(animation == "elasticRight")
{
steps = stepsElastic
v = step/steps
rf=Math.exp(-v*7)
t = v * 1.5*Math.PI
rx =Math.abs(el.initLeft)
elprops.posLeft = rf*Math.cos(t)*rx
elprops.posTop = 0
}
else if(animation == "elasticBottom")
{
steps = stepsElastic
v = step/steps
rf=Math.exp(-v*7)
t = v * 2.5*Math.PI
ry =Math.abs(el.initTop)
elprops.posLeft = 0
elprops.posTop = rf*Math.cos(t)*ry
}
else if(animation == "wipeLR")
{
steps = stepsElastic
if(ie4 && elprops.position=="absolute")
elprops.clip = "rect(0 "+ step/steps*100 +"% 100% 0)"
else if (!ie4)
{
elprops.clip.right=step/steps*el.sizeW
}
}
else if(animation == "wipeTB")
{
steps = stepsElastic
if(ie4 && elprops.position=="absolute")
elprops.clip = "rect(0 100% "+step/steps*el.offsetHeight+"px 0)"
else
elprops.clip.bottom=step/steps*el.sizeH
}
else if(animation == "wipeMID")
{
steps = stepsElastic
if(ie4 && elprops.position=="absolute")
{
elprops.clip = "rect(0 "+el.sizeW/2*(1+step/steps)+"px 100% "+el.sizeW/2*(1-step/steps)+")"
}
else if(!ie4)
{
elprops.clip.right=el.sizeW/2*(1+step/steps)
elprops.clip.left=el.sizeW/2*(1-step/steps)
}
}
else if(animation == "flyCorner")
{
if(!cornerPhase)
{
steps = stepsElastic/2
v = step/steps
rf=Math.exp(-v*7)
t = v * 2.5*Math.PI
ry =Math.abs(el.initTop)
elprops.posTop = rf*Math.cos(t)*ry
}
else
{
steps = stepsFly
dl = el.initLeft / steps
elprops.posLeft = elprops.posLeft - dl
elprops.posTop = 0
}
}
else
{
steps = stepsFly
if(animation == "dropWord" || animation == "flyTopRightWord" || animation == "flyBottomRightWord")
steps = stepsWord
dl = (el.endLeft - el.initLeft) / steps
dt = (el.endTop - el.initTop) / steps
elprops.posLeft = elprops.posLeft + dl
elprops.posTop = elprops.posTop + dt
}
if (step >= steps)
{
if(!(animation == "wipeLR" ||
animation == "wipeTB" ||
animation == "wipeMID" ||
(animation == "flyCorner" && !cornerPhase)))
{
elprops.posLeft = el.endLeft
elprops.posTop = el.endTop
}
if(animOut)
{
elprops.visibility="hidden"
}

step = 0
if(animation=="flyCorner" && !cornerPhase)
cornerPhase=1
else
{
cornerPhase=0
currentElement++
}

}
if(!ie4)
{
elprops.left=elprops.posLeft
elprops.top =elprops.posTop
}
if(currentElement < animateElements.length)
{
if(animOut)
window.setTimeout("animate(1);", speed, "Javascript")
else
window.setTimeout("animate(0);", speed, "Javascript")
}
else
currentElement=0
}
function rollIn(el)
{
var ms = navigator.appVersion.indexOf("MSIE")
ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
if(ie4)
{
el.initstyle=el.style.cssText;el.style.cssText=el.fprolloverstyle
}
}
function rollOut(el)
{
var ms = navigator.appVersion.indexOf("MSIE")
ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
if(ie4)
{
el.style.cssText=el.initstyle
}
}
function clickSwapStyle(el)
{
var ms = navigator.appVersion.indexOf("MSIE")
ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
if(ie4)
{
ts=el.style.cssText
el.style.cssText=el.fprolloverstyle
el.fprolloverstyle=ts
}
}
function clickSwapImg(el)
{
if(document.all || document.layers)
{
ts=el.src
el.src=el.lowsrc
el.lowsrc=ts
}
}
//-->

</script>
</head>

<body oncontextmenu=alert('^o^Hello!欢迎您光临动易网络!');event.returnValue=false;
oncopy=alert('^o^Hello!欢迎光临ASPEASE.COM!');event.returnValue=false;
onload="dynAnimation()" language="Javascript1.2">

<p dynamicanimation="fpAnimwaveWordsFP1" id="fpAnimwaveWordsFP1" style="position: relative !important; visibility: hidden" language="Javascript1.2"><img border="0" src="http://www.aspease.com/images/logo.gif" width="88" height="31"></p>

</body>

</html>



2006-04-25 12:40
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

文本加密及解密器
要完成此效果需要两个步骤

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Encrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
rnd = Math.round(Math.random() * 122) + 68;
Temp[i] = theText.charCodeAt(i) + rnd;
Temp2[i] = rnd;
}
for (i = 0; i < TextSize; i++) {
output += String.fromCharCode(Temp[i], Temp2[i]);
}
return output;
}
function unEncrypt(theText) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = theText.length;
for (i = 0; i < TextSize; i++) {
Temp[i] = theText.charCodeAt(i);
Temp2[i] = theText.charCodeAt(i + 1);
}
for (i = 0; i < TextSize; i = i+2) {
output += String.fromCharCode(Temp[i] - Temp2[i]);
}
return output;
}
// End -->
</script>


<center>
<form name=encform onsubmit="return false;">
<textarea name=box1 rows=5 cols=50>Typhoon Start JavaScript Fairyland

2006-04-25 12:40
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 
始终在页面底部的菜单
<title>始终在页面底部的菜单</title>
<head>
<script language="javascript">
<!--
function stat(){
var a = pageYOffset+window.innerHeight-document.bar.document.height-0
document.bar.top = a
setTimeout('stat()',2)
}
function fix(){
nome=navigator.appName
if(nome=='Netscape'){
stat()
}
else{
var a=document.body.scrollTop+document.body.clientHeight-document.all.bar.offsetHeight+0
bar.style.top = a
}}
//-->
</script>
</head>
<body onLoad="fix()" onScroll="fix()" onResize="fix()">
<span id="bar" style="position:absolute; left:68px; top:455px; width:614px; height:45px; z-index:9" >
<table border="1" hspace="1" cellpadding="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr align="center">
<td width="190"> <a href="#">音乐秀</a></td>
<td width="147"> <a href="#">音乐秀</a></td>
<td width="96"> <a href="#">音乐秀</a></td>
<td width="158"> <a href="#">音乐秀</a>
</td>
</tr>
</table>
</span>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
<br><center><input type="button" onclick="window.location.href='jscode.asp?js_id=34'" style="BORDER-RIGHT: #a2a2a2 1px solid; BORDER-TOP: #ffffff 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #ffffff 1px solid; COLOR: #333333; BORDER-BOTTOM: #a2a2a2 1px solid; HEIGHT: 20px; BACKGROUND-COLOR: #eeeeee" value="查看代码"></center><br>
2006-04-25 12:41
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 
始终在页面底部的菜单
<title>始终在页面底部的菜单</title>
<head>
<script language="javascript">
<!--
function stat(){
var a = pageYOffset+window.innerHeight-document.bar.document.height-0
document.bar.top = a
setTimeout('stat()',2)
}
function fix(){
nome=navigator.appName
if(nome=='Netscape'){
stat()
}
else{
var a=document.body.scrollTop+document.body.clientHeight-document.all.bar.offsetHeight+0
bar.style.top = a
}}
//-->
</script>
</head>
<body onLoad="fix()" onScroll="fix()" onResize="fix()">
<span id="bar" style="position:absolute; left:68px; top:455px; width:614px; height:45px; z-index:9" >
<table border="1" hspace="1" cellpadding="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr align="center">
<td width="190"> <a href="#">音乐秀</a></td>
<td width="147"> <a href="#">音乐秀</a></td>
<td width="96"> <a href="#">音乐秀</a></td>
<td width="158"> <a href="#">音乐秀</a>
</td>
</tr>
</table>
</span>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
<br><center><input type="button" onclick="window.location.href='jscode.asp?js_id=34'" style="BORDER-RIGHT: #a2a2a2 1px solid; BORDER-TOP: #ffffff 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #ffffff 1px solid; COLOR: #333333; BORDER-BOTTOM: #a2a2a2 1px solid; HEIGHT: 20px; BACKGROUND-COLOR: #eeeeee" value="查看代码"></center><br>

2006-04-25 12:42
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

最新款式的万年历

要完成此效果把如下代码加入到<body>区域中
<script language="JavaScript">
<!-- for sucky browsers
Months = new Array(12);
Months[0] = "一月";
Months[1] = "二月";
Months[2] = "三月";
Months[3] = "四月";
Months[4] = "五月";
Months[5] = "六月";
Months[6] = "七月";
Months[7] = "八月";
Months[8] = "九月";
Months[9] = "十月";
Months[10] = "十一月";
Months[11] = "十二月";

function PadSpaces(TheString)
{
var Spaces = " ";
len = Math.round((9 - TheString.length)/2);

return Spaces.substring(0,len) + TheString;
}

function NumLeapYears(StartYear, EndYear)
{
var LeapYears, i;

if (EndYear >= StartYear){
for(LeapYears = 0; StartYear <= EndYear; StartYear++)
if (IsLeapYear(StartYear)) LeapYears++;
}else{
for(LeapYears = 0; EndYear <= StartYear; EndYear++)
if (IsLeapYear(EndYear)) LeapYears++;
}
return LeapYears;
}

function IsLeapYear(Year)
{
if(Math.round(Year/4) == Year/4){
if(Math.round(Year/100) == Year/100){
if(Math.round(Year/400) == Year/400)
return true;
else return false;
}else return true;
}
return false;
}

function Trim(TheString)
{
var len;

len = TheString.length;
while(TheString.substring(0,1) == " "){ //trim left
TheString = TheString.substring(1, len);
len = TheString.length;
}

while(TheString.substring(len-1, len) == " "){ //trim right
TheString = TheString.substring(0, len-1);
len = TheString.length;
}
return TheString;
}

function DetermineMonthIdx()
{
var i, month, month_s, len;


month = Trim(document.calform.elements[4].value);
len = month.length;

for( i = 0; i <12; i++){
month_s = Months[i].substring(0,len);
if (month_s.toUpperCase() == month.toUpperCase())
return (i);
}
return -1;
}

function FindNewYearStartingDay(Year)
{
var LeapYears, Years, Day;

LeapYears = NumLeapYears(1995, Year);

if (Year >=1995)
Years = (Year -1995)+LeapYears;
else Years = (Year -1995)-LeapYears;

if (Year >=1995)
Day = Math.round(((Years/7 - Math.floor(Years/7))*7)+.1);
else Day = Math.round(((Years/7 - Math.ceil(Years/7))*7)-.1);

if (Year >=1995){
if(IsLeapYear(Year)) Day--;
}else Day += 7;

if(Day < 0) Day = 6;
if(Day > 6) Day = 0;
return Day;
}

function FindNumDaysInMonth(Year, Month)
{
if(Month == 1){
if(IsLeapYear(Year)) return 29;
else return 28;
}else{
if(Month >6) Month++;
if(Month/2 == Math.round(Month/2)) return 31;
}
return 30;
}

function FindMonthStartDay(NewYearDay, Year, Month)
{
var MonthStartDay;

AddArray = new Array(12);

AddArray[0]=0;AddArray[1]=3;AddArray[2]=3;AddArray[3]=6;
AddArray[4]=1;AddArray[5]=4;AddArray[6]=6;AddArray[7]=2;
AddArray[8]=5;AddArray[9]=0;AddArray[10]=3;AddArray[11]=5;

MonthStartDay = NewYearDay + AddArray[Month];
if(IsLeapYear(Year) && (Month ) > 1) MonthStartDay ++;

if (MonthStartDay > 6) MonthStartDay -= 7;

return MonthStartDay;
}

function FillCalendar()
{
var Year, Month, Midx, NewYearDay, MonthStartDay;
var NumDaysInMonth, i, t;

Year = parseFloat(document.calform.elements[1].value);
Month = document.calform.elements[4].value;

Midx = DetermineMonthIdx();
if (Midx == -1){
alert ("Can't recognize that month");
return;
}

NewYearDay = FindNewYearStartingDay(Year);
MonthStartDay = FindMonthStartDay(NewYearDay, Year, Midx);
NumDaysInMonth = FindNumDaysInMonth(Year, Midx);

for(i = 6; i < 43; i++){
t = i-5-MonthStartDay;
if ( t >= 1 && t <= NumDaysInMonth)
document.calform.elements[i].value =t;
else document.calform.elements[i].value = "";
}
}

function IncDecYear(val)
{
var valNum = parseInt(val);
var valNum2 = parseInt(document.calform.elements[1].value)
document.calform.elements[1].value = valNum2 + valNum;

FillCalendar()
}

function IncDecMonth(val)
{
var valNum = parseInt(val);
var Midx = DetermineMonthIdx();

Midx += valNum;
if(Midx > 11) Midx = 0;
if(Midx < 0) Midx = 11;


document.calform.elements[4].value = PadSpaces(Months[Midx]);

FillCalendar()
}

// -->
</script>
<table border=1 bgcolor="#000000" cellpadding=1 cellspacing=1>
<table border=0 cellpadding=0 cellspacing=0>
<form name="calform">
<tr>
<td align=center cellpadding=0 cellspacing=0 bgcolor="#000000">
<input
type=button value="<<" onClick="IncDecYear(-1)" name="button">
</td>
<th cellpadding=0 cellspacing=0 bgcolor="#aaaaaa" colspan=5
align=center>
<input size=4 type=text value="1993" name="text">
</th>
<td align=center cellpadding=0 cellspacing=0 bgcolor="#000000">
<input
type=button value=">>" onClick="IncDecYear(1)" name="button2">
</td>
</tr>
<tr>
<td align=center bgcolor="#000000">
<input type=button value="<<"
onClick="IncDecMonth(-1)" name="button2">
</td>
<th bgcolor="#aaaaaa" colspan=5 align=center>
<input size=9 type=text
value=" January " name="text">
</th>
<td align=center bgcolor="#000000">
<input type=button value=">>"
onClick="IncDecMonth(1)" name="button2">
</td>
</tr>
<tr>
<th bgcolor="#ffcccc">S</th>
<th bgcolor="#ccccff">M</th>
<th bgcolor="#ccccff">T</th>
<th bgcolor="#

2006-04-25 12:46
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

自定义窗口大小打开某个页面

<script>
var testWin;
function resTest(w,h) {
frm = document.forms[0];
urlF = frm.testURL.value;
if(urlF == "" || urlF == "http://") {
alert('请输入网址');
frm.testURL.focus();
return false;
}
if(w == null) {
w = frm.customw.value;
if(w == "" || !Number(w) || w < 100) {
alert('请输入有效的宽,要不小于100');
frm.customw.value = "";
frm.customw.focus();
return false;
}
}
if(h == null) {
h = frm.customh.value;
if(h == "" || !Number(h) || h < 100) {
alert('请输入有效的高,要不小于100');
frm.customh.value = "";
frm.customh.focus();
return false;
}
}
properties = "width=" + w;
properties += ",height=" + h;
properties += ",scrollbars=1,toolbar=1,location=1";
properties += ",directories=1,status=1,menubar=1";
properties += ",resizable=1,left=0,top=0";
if(testWin && !testWin.closed) {
testWin.close();
}
testWin = window.open(urlF,"TestRes",properties);
if(navigator.appName.indexOf("Netscape") != -1) {
testWin.outerWidth = w;
testWin.outerHeight = h;
}
frm.innerDim.value = "自定义窗口大小为: " + w + "x" + h + "\n";
if(navigator.appName.indexOf("Netscape") != -1) {
frm.innerDim.value += "Window Inner Width: " + testWin.innerWidth + "\n";
frm.innerDim.value += "Window Inner Height: " + testWin.innerHeight + "\n\n";
}
else {
frm.innerDim.value += "下面是标准的IE窗口大小及显示大小:\n\n";
frm.innerDim.value += "窗口 显示\n";
frm.innerDim.value += "640x480 -> 615x314\n";
frm.innerDim.value += "800x600 -> 775x434\n";
frm.innerDim.value += "1024x768 -> 999x602";
}
this.focus();
}
</script>
<form>
<div align="center">网址:
<input type=text name="testURL" SIZE="25" value="http://">
<br>
<br>
宽:
<input type=text name="customw" SIZE="4">
高:
<input type=text name="customh" SIZE="4">
<input type=button value="自定" onClick="resTest()">
<br>
标准 <br>
<input type=button value="640 x 480" onClick="resTest('640','480')">
<input type=button value="800 x 600" onClick="resTest('800','600')">
<input type=button value="1024 x 768" onClick="resTest('1024','768')">
<br>
<br>
<textarea name="innerDim" rows="7" cols="40" wrap="physical">此文本框内显示的是窗口展示的数据项...
2006-04-25 12:47
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

结合的很酷的文本滚动与网页飞花的特效!!


<SCRIPT language=JavaScript>


//设置marquee的宽度(in pixels)
var marqueewidth=190
//设置marquee的高度
var marqueeheight=200
//设置marquee的速度
var speed=1
//设置marquee的显示内容
var marqueecontents=

ef="<center><p>加如文章的内容</center>"

if (document.all)
document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}

window.onload=regenerate2
</SCRIPT>

<script language="JavaScript1.2"><!-- Begin
var no = 20; // snow number
var speed = 10; // smaller number moves the snow faster
var snowflake = "pic/meihua.gif";

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
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();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"" + snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"" + snowflake + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src=\"" + snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src=\"" + snowflake + "\" border=\"0\"></div>");
}
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}

function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End -->
</script>

2006-04-25 12:49
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

爱情测试小游戏

<BODY bgColor=#ffffff leftMargin=0
onmouseover="window.status='本站网址: Jojoo.net';return true" topMargin=1>

<SCRIPT language=JavaScript>
<!-- ;

alert("照着屏幕上说的写,可不要乱写,你会后悔的!");
// end hide --></SCRIPT>
一个
<SCRIPT><!-- iniciar
var WEATHER = prompt("输入你最喜欢的气候","")
document.write(" " + WEATHER + " ") // finalizar --></SCRIPT>
的午後,你正在
<SCRIPT><!-- iniciar
var PLACE1 = prompt("输入你最喜欢的地方","")
document.write(" " + PLACE1 + " ")
// finalizar --></SCRIPT>
愉快的
<SCRIPT><!-- iniciar
var ACTN = prompt("输入你最喜欢作的事","")
document.write(" " + ACTN + " ")
// finalizar --></SCRIPT>
时,你看到了一个世上最
<SCRIPT><!-- iniciar
var ADJ1 = prompt("输入一个词形容你喜欢的异性","")
document.write(" " + ADJ1 + " ")
// finalizar --></SCRIPT>
的人。
<SCRIPT><!-- iniciar
var SEX = prompt("你所喜欢的是'他'还是'她'?","")
document.write(" " + SEX + " ")
// finalizar --></SCRIPT>
叫做
<SCRIPT><!-- iniciar
var NAME1 = prompt("输入你所喜欢异性的名字","")
document.write(" " + NAME1 + " ")
// finalizar --></SCRIPT>

<SCRIPT><!-- iniciar
document.write(" " + SEX + " ")
// finalizar --></SCRIPT>
的每个动作都十分吸引你,於是你对你的好朋友
<SCRIPT><!-- iniciar
var NAME2 = prompt("输入你好朋友的名字","")
document.write(" " + NAME2 + " ")
// finalizar --></SCRIPT>
说 : "看那边! 那是我看过最
<SCRIPT><!-- iniciar
var ADJ3 = prompt("输入一个形容词","")
document.write(" " + ADJ3 + " ")
// finalizar --></SCRIPT>
的人了!" 突然间,
<SCRIPT><!-- iniciar
document.write(" " + SEX + " ")
// finalizar --></SCRIPT>
向你这边看了一眼并开始朝你走过来!!!
<SCRIPT><!-- iniciar
document.write(" " + SEX + " ")
// finalizar --></SCRIPT>
说 : "我早就发现你在偷偷看我了。说实话,我觉得你满
<SCRIPT><!-- iniciar
var ADJ4 = prompt("输入一个词形容你自己","")
document.write(" " + ADJ4 + " ")
// finalizar --></SCRIPT>
的。你愿意跟我去
<SCRIPT><!-- iniciar
var PLACE2 = prompt("输入另一个你喜欢的地方","")
document.write(" " + PLACE2 + " ")
// finalizar --></SCRIPT>
然後一起
<SCRIPT><!-- iniciar
document.write(" " + ACTN + " ")
// finalizar --></SCRIPT>
吗?" 你露出了一个兴奋的微笑并说 : "
<SCRIPT><!-- iniciar
var PHRASE = prompt("输入一个你认为最酷的话","")
document.write(" " + PHRASE + " ")
// finalizar --></SCRIPT>
" 便一起走了。当你们到达
<SCRIPT><!-- iniciar
document.write(" " + PLACE2 + " ")
// finalizar --></SCRIPT>
时,
<SCRIPT><!-- iniciar
document.write(" " + SEX + " ")
// finalizar --></SCRIPT>
突然移进你并在你的脸颊上温柔的亲了一下。当你正陶醉在其中时,一个
<SCRIPT><!-- iniciar
var NOUN = prompt("输入在你房间有的东西","")
document.write(" " +NOUN+ " ")
// finalizar --></SCRIPT>
重重的打在你的头上。你睁开眼,发现原来只是个梦,但是你在身旁发现了一个纸条写道 : "
<SCRIPT><!-- iniciar
document.write(" " + NAME1 + " ")
// finalizar --></SCRIPT>
是你的最爱。
<SCRIPT><!-- iniciar
document.write(" " + SEX + " ") // finalizar --></SCRIPT>
将会问你是否愿意和
<SCRIPT><!-- iniciar
document.write(" " + SEX + " ") // finalizar --></SCRIPT>
交往。 但你必须在
<SCRIPT><!-- iniciar
var NUM = prompt("输入你的幸运号码","")
document.write(" " + NUM + " ")
// finalizar --></SCRIPT>
天以内带10个人以上来<FONT color=#ff3300>“懒汉在线”----今晚也会笑</FONT>,不然你将会有
<SCRIPT><!-- iniciar
document.write(" " + NUM + " ")
// finalizar --></SCRIPT>
年的厄运!!"

2006-04-25 12:50
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

填空游戏 (不简单哟)


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

<SCRIPT LANGUAGE='JavaScript'>


function fillall(){
for (var i = 0; i < 24; i++) {
document.form.elements[i].checked=1
}
}

function clearall(){
for (var i = 0; i < 24; i++) {
document.form.elements[i].checked=0
}
}

function level1(){
clearall()
document.form.elements[10].checked=1
document.form.elements[12].checked=1
document.form.elements[14].checked=1
}

function level2(){
clearall()
document.form.elements[12].checked=1
document.form.elements[16].checked=1
document.form.elements[17].checked=1
document.form.elements[18].checked=1
document.form.elements[20].checked=1
document.form.elements[21].checked=1
document.form.elements[22].checked=1
document.form.elements[23].checked=1
document.form.elements[24].checked=1
}

function level3(){
fillall()
document.form.elements[4].checked=0
document.form.elements[6].checked=0
document.form.elements[7].checked=0
document.form.elements[8].checked=0
document.form.elements[11].checked=0
document.form.elements[12].checked=0
document.form.elements[13].checked=0
document.form.elements[16].checked=0
document.form.elements[17].checked=0
document.form.elements[18].checked=0
document.form.elements[24].checked=0
}

function level4(){
clearall()
document.form.elements[2].checked=1
document.form.elements[6].checked=1
document.form.elements[8].checked=1
document.form.elements[10].checked=1
document.form.elements[12].checked=1
document.form.elements[14].checked=1
document.form.elements[16].checked=1
document.form.elements[18].checked=1
document.form.elements[22].checked=1
}

function level5(){
clearall()
document.form.elements[11].checked=1
document.form.elements[16].checked=1
document.form.elements[21].checked=1
}

function checkall(){
var win=1;
for (var i = 0; i < 24; i++) {
if (document.form.elements[i].checked==1) {
win=0;
}
}
if (win==1){
alert("\n You Did It!!\n")
}
}

function check(v){
q=5;
w=1;
row=parseInt(v/q)+w;
if (isNaN(row)) {
row=1;
}

intv = parseInt(v);
a=eval(intv+q);
b=eval(intv-q);
c=eval(intv+w);
d=eval(intv-w);

if (a<0 || a>24){
a=25;
}
if (b<0 || b>24){
b=25;
}
if (c<0 || c>24){
c=25;
}
if (d<0 || d>24){
d=25;
}

kc = (parseInt(c/q)+w)
kd = (parseInt(d/q)+w)
kv = row;
if (kc != kv){
c=25;
}
if (kd != kv){
d=25;
}

if (v==5) d=25;//correction for strange bug

if (document.form.elements[a].checked == 1) {
document.form.elements[a].checked=0
}
else {
document.form.elements[a].checked=1
}
if (document.form.elements[b].checked == 1) {
document.form.elements[b].checked=0
}
else {
document.form.elements[b].checked=1
}
if (document.form.elements[c].checked == 1) {
document.form.elements[c].checked=0
}
else {
document.form.elements[c].checked=1
}
if (document.form.elements[d].checked == 1) {
document.form.elements[d].checked=0
}
else {
document.form.elements[d].checked=1
}
checkall()
}

</SCRIPT>
<font color="#33FF33">看看能不能把框框都打上勾</font> </div>
<FORM NAME=form>
<TABLE COLSPEC="L20 L20 L20 L20 L20" BORDER=7 align="center">
<CAPTION ALIGN=TOP>
</CAPTION>
<TR>
<TD><INPUT TYPE=CHECKBOX VALUE=0 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=1 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=2 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=3 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=4 ONCLICK="check(value)"></TD>
</TR>

<TR>
<TD><INPUT TYPE=CHECKBOX VALUE=5 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=6 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=7 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=8 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=9 ONCLICK="check(value)"></TD>
</TR>

<TR>
<TD><INPUT TYPE=CHECKBOX VALUE=10 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=11 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=12 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=13 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=14 ONCLICK="check(value)"></TD>
</TR>

<TR>
<TD><INPUT TYPE=CHECKBOX VALUE=15 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=16 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=17 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=18 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=19 ONCLICK="check(value)"></TD>
</TR>

<TR>
<TD><INPUT TYPE=CHECKBOX VALUE=20 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=21 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=22 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=23 ONCLICK="check(value)"></TD>
<TD><INPUT TYPE=CHECKBOX VALUE=24 ONCLICK="check(value)"></TD>
</TR>

</TABLE>

<div align="center"><BR>
</div>
<TABLE BORDER=10 align="center">
<TR>
<TD><A HREF="JavaScript:level1()">Level 1</A></TD>
<TD><A HREF="JavaScript:level2()">Level 2</A></TD>
</TR>

<TR>
<TD><A HREF="JavaScript:level3()">Level 3</A></TD>
<TD><A HREF="JavaScript:level4()">Level 4</A></TD>
</TR>

<TR>
<TD><A HREF="JavaScript:level5()">Level 5</A></TD>
<TD><INPUT TYPE="RESET" VALUE="Clear"></TD>
</TR>
</TABLE>
<div align="center"></div>
</FORM>

2006-04-25 12:51
快速回复:无聊找了点网页特效代码!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019791 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved