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

文字从右弹出


脚本说明:
把如下代码加入<head>区域中

<script language="JavaScript">
var MESSAGE = " 欢迎来到细溪驿站,请多提意见。谢谢! "
var POSITION = 150
var DELAY = 10
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>

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

标题栏里多段标题文字的替换显现
要完成此效果把如下代码加入到<head>区域中

<SCRIPT LANGUAGE="JavaScript">
var message = new Array();
message[0] = "Welcome To You...";
message[1] = "细溪驿站...";
message[2] = "jojoo@jojoo.net...";


var reps = 1;
var speed = 275;// Set the overall typing speed (larger number = slower action).
var hold = 4 // set the length of time to display the whole phrase before retyping (larger number = longer)

var p = message.length;
var q = 0;
var r = 0;
var C = 0;
var mC = 0;
var s = 0;
var sT = null;

if (reps < 1) {
reps = 1;
}
function setMessage() {
typing = message[mC];
q = typing.length;
r = q + hold;
typeMessage();
}
function typeMessage() {
if (s > r) {
s = 0;
}
if (s > q) {
document.title = '|- '+ typing +' - - -';
}
else {
document.title = '|- '+ typing.substr(0,s)+' - - -';
}
if (C < (r * reps)) {
sT = setTimeout("typeMessage()", speed);
C++;
s++;
}
else {
C = 0;
s = 0;
mC++;
if(mC > p - 1) {mC = 0;}
sT = null;
setMessage();
}
}
setMessage();
</script>

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

状态栏显示链接内容特效

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var data = "0123456789";
var done = 1;
function statusIn(text) {
decrypt(text, 2, 1);
}

function statusOut() {
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;
}
}
}
}
// End -->
</script>

<center>
<a href="http://www.jojoo.net/"
onMouseOver="statusIn('细溪驿站. [http://www.jojoo.net/]');return true;"
onMouseOut="statusOut();">JavaScript Fairyland</a>
</center>

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

背景向下移动的脚本

<SCRIPT language=VBScript>
dim c,numgc
c=-100000
numgc=document.body.sourceIndex
sub SF
c=c+2
Document.all(numgc).style.BackgroundPosition="0 "&c
id=SetTimeOut("SF",64,"VBScript")
end sub
SF
</SCRIPT>

<body background=back.jpg onLoad="ob(),setNum(),setInterval('timer()',100);setInterval('runClock()',100)">

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

背景不停变化的脚本

<SCRIPT language=javascript><!--
var pos=10;function initArray(){this.length=initArray.arguments.length;
for(var i=0;i<this.length;i++){this[i]=initArray.arguments[i];}}
var col=new initArray("4b","5b","8b","8b");
col[0]="yellow";col[1]="coral";col[2]="orange";col[3]="red";
col[4]="greenyellow";col[5]="lime";col[6]="turquoise";col[7]="coral";
col[8]="blueviolet";col[9]="violet";
function chgCol(){pos++;if(pos<0||pos>9){pos=0;}document.bgColor=col[pos];
setTimeout("chgCol()",3000);/*这里你可以改变时间间隔.*/
}
var yourwords="不断变化背景色彩";var buffer1=" ";
var buffer2=" ";
var message1=buffer1+yourwords+buffer2;
var dir="left";var speed=150;function pingpong(){
if(dir=="left")
{message2=message1.substring(2,message1.length)+" ";
window.status=message2;setTimeout("pingpong();",speed);message1=message2;
if(message1.substring(0,1)=="*")dir="right";}
else{message2=" "+message1.substring(0,message1.length-2);
window.status=message2;setTimeout("pingpong();",speed);
message1=message2;if(message1.substring(message1.length-1,message1.length)=="*")dir="left";}}//
-->
</SCRIPT>
<body bgColor=#ffffff onload="chgCol(); pingpong();">




2006-04-25 12:56
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 
明天继续!!!!!
2006-04-25 12:57
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 
各位看了还是顶一下哈!
2006-04-25 12:57
我想飞
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2005-9-28
收藏
得分:0 
顶,好贴一定要顶
2006-04-27 02:29
oヤ偽妳變壞
Rank: 2
等 级:新手上路
威 望:4
帖 子:2251
专家分:0
注 册:2006-3-19
收藏
得分:0 

继续那天的!!

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

title栏变化弹出


脚本说明:
把如下代码加入<head>区域中
<script language="javascript">
<!-- Hide me
var index_count = 0;
var title_string = "欢迎光临javascript世界精彩集锦,这里有许多javascript源程序,是您设计主页的最好帮手! ";
var title_length = title_string.length;
var cmon;
var kill_length = 0;
function loopTheScroll()
{
scrollTheTitle();
if(kill_length > title_length)
{
clearTimeout(cmon);
}

kill_length++;
cmon = setTimeout("loopTheScroll();",100)
}

function scrollTheTitle()
{
var doc_title = title_string.substring((title_length - index_count - 1),title_length);
document.title = doc_title;

index_count++;
}


loopTheScroll();

//-->
</script>

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



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

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