如何添加博客特效
发布网友
发布时间:2022-04-23 21:46
我来回答
共1个回答
热心网友
时间:2022-04-24 15:50
常用博客网页特效代码
2005年 01月10日
博客介绍特效、状态栏特效、收藏夹特效、首页特效、如何加入背景音乐、加入百度、google搜索栏............
常用特效全包括。
说明:把下面的特效代码粘贴到博客介绍栏既可。但状态栏特效同时只能用一种。
特效一 博客介绍栏文字滚动
可是设置为向上、向下、向左、向右。可以设置高度,滚动速度。
<MARQUEE scrollAmount=1 direction=up
height=120>你的文字介绍</MARQUEE >
特效二 状态栏滚动文字介绍
自左向右,循环滚动。
<script>
<!--
function Helpor_net(seed)
{ var m1 = "你要显示的文字,如:欢迎来到晓寒工作室" ;
var m2 = "" ;
var msg=m1+m2;
var out = " ";
var c = 1;
var speed = 120;
if (seed > 100)
{ seed-=2;
var cmd="Helpor_net(" + 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="Helpor_net(" + 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="Helpor_net(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,speed);}
else { window.status=" ";
timerTwo=window.setTimeout("Helpor_net(100)",speed);
}
}
}
Helpor_net(100);
-->
</script>
特效三 状态栏文字打字机效果特效
<script language="JavaScript">
var msg = "你要显示的文字,如:欢迎来到晓寒工作室,请多提意见。谢谢! " ;
var interval = 120
var spacelen = 120;
var space10=" ";
var seq=0;
function Helpor_net() {
len = msg.length;
window.status = msg.substring(0, seq+1);
seq++;
if ( seq >= len ) {
seq = 0;
window.status = '';
window.setTimeout("Helpor_net();", interval );
}
else
window.setTimeout("Helpor_net();", interval );
}
Helpor_net();
</script>
特效四 点击即可把你的网站添加到浏览器的收藏菜单下
<span style="CURSOR: hand"
onClick="window.external.addFavorite('你的域名','你的网站名')"
title="你的网站名">收藏本站</span>
特效五 点击即可把你的网站设置为浏览器的起始页
<span onclick="var
strhref="/blog/window.location.href";this.style.behavior='url(#default#homepage)';this.setHomePage('你的域名');"
style="CURSOR: hand">设为首页</span>
特效六 浏览器的状态栏里出现一个字接一个字往左跑的欢迎语!
<script language="JavaScript">
<!--
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
}
var POSITION = 100
var DELAY = 5
var MESSAGE = "你要显示的文字,如:欢迎来到晓寒工作室 "
var scroll = new statusMessageObject()
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>
特效七 鼠标一碰就弹出 设为首页 对话框
<a href="#"
onmouseover="this.style.behavior='url(#default#homepage)';this.setHomePage('你的域名');return(false);"
style="behavior: url(#default#homepage)">设为主页</a></td>
特效八 鼠标一碰就弹出收藏本站对话框
<a href="#"
onmouseover="javascript:window.external.AddFavorite('你的域名',
'你的网站名')" target="_self">收藏本站</a>
特效九 加入背景音乐
<EMBED src="完整的音乐地址" autostart="true" loop="5" width="0"
height="0">
特效十 google搜索栏
<!-- Search Google -->
<center>
<FORM method=GET action="http://www.google.com/search">
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com/intl/zh-CN/">
<IMG SRC="http://www.google.com/logos/Logo_40wht.gif"
border="0" ALT="Google" align="absmiddle"></A>
<INPUT TYPE=text name=q size=23maxlength=255 value="">
<INPUT TYPE=hidden name=hl value=zh-CN>
<INPUT TYPE=hidden name=ie value=GB2312>
<INPUT TYPE=submit name=btnG value="Google搜索">
</td></tr></TABLE>
</FORM>
</center>
<!-- Search Google -->
特效十一 百度搜索栏
<iframe id="frame" border="0" vspace="0" hspace="0"
marginwidth="0" marginheight="0"
framespacing="0" frameborder="0" scrolling="no"
width="200" height="30"
src="http://unstat.baidu.com/bn.bsc?tn=dabaoku&cv=1&cid=31577&csid=102&rkcs=2&bgcr=EDEDEB&ftcr=FF0000&rk=1&bd=1&bdas=0">
</iframe>
特效十二 显示ip及地址
<SCRIPT src='http://free.2259.com/ip/ip.asp'></SCRIPT>
参考资料:未完,不过差不多了,举一反三。
参考资料:百度知道