网页状态栏特效全攻略
时间:2007-02-17 来源:PHP爱好者
在上网时我们注意往往是网站页面内容,而状态栏不会被人太多注意,如果我们给页面的状态栏加一些特效,肯定会使你的网站增添一道风景,下面就给大家介绍7种常见的状态栏特效的Javascript代码。
特效一:滚动显示
第一步:把如下代码加入<head>区域中
<!--
function scrollit(seed) {
var m1 = "HI:你 好! ";
var m2 = "欢迎访问赛迪 ";
var m3 = "请多提意见,谢 谢! ";
var m4 = "欢迎您下次再来! ";
var m5 = "http://www.ccidnet.com ";
var msg=m1+m2+m3+m4+m5;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c <seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed <msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
//-->
</script>
php爱好者站 http://www.phpfans.net c/vc/c++/java.
相关阅读 更多 +