飘雪特效:
飘雪特效是一个非常酷的特效,加入后在您的网页顶端随机出现飘落的雪花,在冬季时,添加到您的网页上,会给人一种纯洁温馨的印象;秋季,可以飘落果实,会给人一种热情成熟的感觉;夏季,可以飘落绿叶,会给人一种充满生机的喜悦。
<body>
<script language="JavaScript1.2">
var snowsrc="你的地址/images/snow.gif"
var no = 10;
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 = 0;
xp = Math.random()*(doc_width-50);
yp = Math.random()*doc_height;
am = Math.random()*20;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
if (ns4up) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"></layer>");
} else if (ie4up) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"></div>");
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp += sty;
if (yp > doc_height-50) {
xp = Math.random()*(doc_width-am-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx += stx;
document.layers["dot"+i].top = yp;
document.layers["dot"+i].left = xp + am*Math.sin(dx);
}
setTimeout("snowNS()", 10);
}
<!-- 此特效使用《网络赚钱,大家一起发》编辑制作-->
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp += sty;
if (yp > doc_height-50) {
xp = Math.random()*(doc_width-am-30);
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx += stx;
document.all["dot"+i].style.pixelTop = yp;
document.all["dot"+i].style.pixelLeft = xp + am*Math.sin(dx);
}
setTimeout("snowIE()", 10);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
</script>
</body>
状态栏文字特效:此特效会在网页状态栏上出现动感十足的文字,对网页会起到很好的点缀效果。文字运动样式有6中,具体效果请浏览1、 循环滚动方式<SCRIPT LANGUAGE=JAVASCRIPT>
<!--
var speed = 300;
var msgud = " " + msg;
function statusScroll() {
if (msgud.length <msg.length) msgud += " - " + msg;
msgud = msgud.substring(1, msgud.length);
window.status = msgud.substring(0, msg.length);
window.setTimeout("statusScroll()", speed);
}
<!-- 此特效使用《网络赚钱,大家一起发》编辑制作-->
</SCRIPT>
<BODY onload="window.setTimeout('statusScroll()', 500)">
2、 逐个排队方式
<script language=JavaScript>
var POSITION=100
var DELAY=5
var scroll=new statusMessageObject()
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}
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>
3、 依次聚积方式
<SCRIPT LANGUAGE=JAVASCRIPT>
function makeArray(n)
{
this.length = n;
for (i=0; i<n; i++) this="";
}
stcnt = 16;
wmsg = new makeArray(32);
wmsg[0]=msg;
blnk =" ";
for (i=1; i<32; i++)
{
b = blnk.substring(0,i);
for (j=0; j<msg.length; j++)
wmsg=wmsg+msg.charAt(j)+b;
}
function wiper()
{
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
window.status = str;
timeID = window.setTimeout("wiper()",150);
}
// -->
<!-- 此特效使用《网络赚钱,大家一起发》编辑制作-->
</SCRIPT>
<body ONLOAD="wiper()">
4、 逐个伸缩方式
<script LANGUAGE="JavaScript">
<!--
// Scrolling message settings
var DisplayLength = 260
var pos = 1 - DisplayLength;
function ScrollInStatusBar(){
var scroll = "";
pos++;
if (pos == MessageText.length) pos = 1 - DisplayLength;
if (pos<0) {
for (var i=1; i<=Math.abs(pos); i++)
scroll = scroll + "";
scroll = scroll + MessageText.substring(0, DisplayLength - i + 1);
}
else
scroll = scroll + MessageText.substring(pos, pos + DisplayLength);
window.status = scroll;
//Scrolling speed
setTimeout("ScrollInStatusBar()",0);
}
ScrollInStatusBar()
//-->
<!-- 此特效使用《网络赚钱,大家一起发》编辑制作-->
</script>
5、 不停闪烁方式
<script language="">
<!--
var speed = 700;
var control = 1;
function flash()
{
if (control == 1)
{
window.status=yourwords;
control=0;
}
else
{
window.status=" ";
control=1;
}
setTimeout("flash()",speed);
}
window.onload=flash
<!-- 此特效使用《网络赚钱,大家一起发》编辑制作-->
// -->
</script>
6、 打印效果方式
<SCRIPT LANGUAGE="JavaScript">
var chars = msg.length + 1;
var updateStatus = "";
var i = 0;
function statusMessage() {
if (i < chars) setTimeout("nextLetter()", 300);
}
<!-- 此特效使用《网络赚钱,大家一起发》编辑制作-->
function nextLetter() {
updateStatus = msg.substring(0,i) + '_';
window.status = updateStatus;
i++;
statusMessage();
}
</script>
<body onLoad="statusMessage()">
1、页面特效:35个