字符慢慢右移:在状态栏上显示的字符慢慢向右移动,而且会来回运动
效果演示: 看看状态栏的效果
把如下代码加入<body>区域中
<SCRIPT LANGUAGE="javascript">
function wh_showStatus(){
if (wh_StatusType == "left") {
wh_StatusText = " " + wh_StatusText;
}
else
if (wh_StatusType == "right") {
wh_StatusText = wh_StatusText.substring(1,wh_StatusText.length);
}
if (wh_StatusText == "" || wh_StatusText.length > 80) {
wh_StatusText = "…………网页大宝库网页素材欢迎您…………";
if (wh_StatusType == "right") {
while (wh_StatusText.length < 80) wh_StatusText = " " + wh_StatusText;
}
}
status = wh_StatusText;
setTimeout("wh_showStatus()",wh_StatusSpeed);
}
wh_StatusText = "…………网页制作大宝库网页特效欢迎您…………";
wh_StatusSpeed = 100;
wh_StatusType = "left";
if (wh_StatusType == "right") {
while (wh_StatusText.length < 80) wh_StatusText = " " + wh_StatusText;
}
setTimeout("wh_showStatus()",wh_StatusSpeed);
</SCRIPT>
文字缩放:状态栏的文字象弹簧一样不停缩放
效果演示: 看看状态栏的效果
以下是源代码:
<script LANGUAGE="JavaScript">
<!--
// Scrolling message settings
var MessageText = "欢迎光临◆网页制作大宝库◆--http://www.dabaoku.com"
var DisplayLength = 100
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>
状态栏特效
文字接力棒:状态栏的字母象接力棒依次由小写变大写
效果演示:
把以下代码放入<body>区域:
<script language="JavaScript">
<!--
var text = "ahttp://www.dabaoku.com!-- http://www.dabaoku.com/"
var speed = 50
var x = 0
function bb() {
var a = text.substring(0,x)
var b = text.substring(x,x+1).toUpperCase()
var c = text.substring(x+1,text.length)
window.status = a + b + c
if (x == text.length) {
x = 0
}
else {
x++
}
setTimeout("bb()",speed)
}
bb();
// --></script>
文字从右到左:状态栏的文字从右到左移动
效果演示: 看看状态栏的效果
以下是源代码:
<script>
<!-- Beginning of JavaScript Applet -------------------
function scrollit_r2l(seed)
{ var m1 = "状态栏文字运动 " ;
var m2 = " " ;
var msg=m1+m2;
var out = " ";
var c = 1;
var speed = 300
if (seed > 100)
{ seed-=2;
var cmd="scrollit_r2l(" + 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="scrollit_r2l(" + 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="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,speed);}
else { window.status=" ";
timerTwo=window.setTimeout("scrollit_r2l(100)",speed);
}
}
}
scrollit_r2l(100);
// -- End of JavaScript code -->
</script>
网页鼠标特效
绕鼠标旋转的流星:一串流星绕鼠标旋转,效果真的很爽
效果演示:
以下是源代码:
<script language=JavaScript>
/*
Magic Wand cursor II (By Kurt at kurt.grigg@virgin.net)
Modified and permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
if (document.all){
with (document){
write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
write('<div style="position:relative;width:1px;height:1px;background:#6699CC;font-size:1px;visibility:visible"></div>')
write('<div style="position:relative;width:1px;height:1px;background:#6699CC;font-size:1px;visibility:visible"></div>')
write('<div style="position:relative;width:1px;height:1px;background:#6699CC;font-size:1px;visibility:visible"></div>')
write('<div style="position:relative;width:1px;height:1px;background:#6699CC;font-size:1px;visibility:visible"></div>')
write('<div style="position:relative;width:1px;height:1px;background:#6699CC;font-size:1px;visibility:visible"></div>')
write('<div style="position:relative;width:1px;height:1px;background:#6699CC;font-size:1px;visibility:visible"></div>')
write('<div style="position:relative;width:1px;height:1px;background:#6699CC;font-size:1px;visibility:visible"></div>')
write('<div style="position:relative;width:2px;height:2px;background:#6699CC;font-size:2px;visibility:visible"></div>')
write('<div style="position:relative;width:2px;height:2px;background:#6699CC;font-size:2px;visibility:visible"></div>')
write('<div style="position:relative;width:2px;height:2px;background:#6699CC;font-size:2px;visibility:visible"></div>')
write('<div style="position:relative;width:2px;height:2px;background:#6699CC;font-size:2px;visibility:visible"></div>')
write('<div style="position:relative;width:2px;height:2px;background:#6699CC;font-size:2px;visibility:visible"></div>')
write('<div style="position:relative;width:2px;height:2px;background:#6699CC;font-size:2px;visibility:visible"></div>')
write('<div style="position:relative;width:3px;height:3px;background:#6699CC;font-size:3px;visibility:visible"></div>')
write('</div>')
}
}
if (document.layers)
{window.captureEvents(Event.MOUSEMOVE);}
var yBase = 200;
var xBase = 200;
var step = 1;
var currStep = 0;
var Xpos = 1;
var Ypos = 1;
if (document.all)
{
function MoveHandler(){
Xpos = document.body.scrollLeft+event.x;
Ypos = document.body.scrollTop+event.y;
}
document.onmousemove = MoveHandler;
}
else if (document.layers)
{
function xMoveHandler(evnt){
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = xMoveHandler;
}
function animateLogo() {
if (document.all)
{
yBase = window.document.body.offsetHeight/6;
xBase = window.document.body.offsetWidth/6;
}
else if (document.layers)
{
yBase = window.innerHeight/8;
xBase = window.innerWidth/8;
}
if (document.all)
{
for ( i = 0 ; i < starsDiv.all.length ; i++ )
{
starsDiv.all[i].style.top = Ypos + yBase*Math.sin((currStep + i*4)/12)*Math.cos(400+currStep/200);
starsDiv.all[i].style.left = Xpos + xBase*Math.sin((currStep + i*3)/10)*Math.sin(currStep/200);
}
}
else if (document.layers)
{
for ( j = 0 ; j < 14 ; j++ ) //number of NS layers!
{
var templayer="a"+j
document.layers[templayer].top = Ypos + yBase*Math.sin((currStep + j*4)/12)*Math.cos(400+currStep/200);
document.layers[templayer].left = Xpos + xBase*Math.sin((currStep + j*3)/10)*Math.sin(currStep/200);
}
}
currStep+= step;
setTimeout("animateLogo()", 10);
}
animateLogo();
</script>
鼠标点击效果:点击鼠标,你一定会乐得心花怒放
效果演示:
第一步:把如下代码加入<head>区域中
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
var ver = navigator.appVersion;
var dom = document.getElementById ? 1 : 0;
var ie5 = (ver.indexOf("MSIE 5") > -1 && dom) ? 1 : 0;
var n = (document.layers);
var ie = (document.all);
var sparksAflyin = 0;
var totalSparks = 0;
var sparksOn = 1;
function initMouseEvents() {
document.onmousedown = mouseDown;
if (n) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
}
function mouseDown(e) {
if (sparksOn) {
var mousex = (n) ? e.pageX : event.x+document.body.scrollLeft;
var mousey = (n) ? e.pageY : event.y+document.body.scrollTop;
if (!sparksAflyin) {
for (var k = 0; k <= 9; k++)
eval('SHOW("sDiv'+k+'")');
sparksAflyin = 1;
totalSparks = 0;
for(i = 0;i <= 9; i++)
eval('moveTo('+i+',0,'+mousex+','+mousey+')');
}
}
}
function moveTo(i,j, mousex, mousey){
if (j < eval('anim_'+i+'_x.length') ){
var tempx = eval('anim_'+i+'_x[j]+mousex');
var tempy = eval('anim_'+i+'_y[j]+mousey');
if (ie) {
if(tempy+30 > (document.body.offsetHeight+document.body.scrollTop))
tempy = docum
网页设计的一些特殊精美效果代码
需积分: 10 119 浏览量
2008-11-21
18:05:32
上传
评论 1
收藏 34KB RAR 举报
jinling843643364
- 粉丝: 30
- 资源: 61
最新资源
- 基于HOG和SVM的人脸口罩识别算法matlab代码+说明文档.zip
- 排序实验.cpp
- 二叉树-基于C语言实现的二叉树动态可视化打印.zip
- 9e4b957740da1abcf3772babc8320259e6dba32e.jpg
- u_567203736_1646727498&fm_253&app_138&f_JPEG.jpeg
- u_2243549021_4135333655&fm_253&fmt_auto&app_138&f_JPEG.jpeg
- v2-27052acdaf76c83922770a9caa6b7880_r.jpg
- 使用JavaScript实现的排序二叉树.zip
- 实验8.doc
- 1280.jpeg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈