设为首页 加入收藏
当前位置:首页 > 整站内容 > 特效代码 > 文本特效 > 详细内容
水波式切换动态文字
发布时间:2010-3-16  阅读次数:8607  字体大小: 【】 【】【

<html>

<head>
<title>网页特效|Linkweb.cn/Js|---水波式切换动态文字</title>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type">
</head>

<body bgColor="#000000" onload="initiate()">
<script language="JavaScript">
<!-- Beginning of JavaScript -
// Your messages. Add as many as you like
var message=new Array()
message[0]="欢迎学习网页特效制作,网页制作从此轻松!"
message[1]="这里有网页特效,免费资源,网页素材,教程!"
message[2]="网页特工,网缘无限,请进社区!"

// the URLs of your messages
var messageurl=new Array()
messageurl[0]="http://linkweb.cn/js"
messageurl[1]="http://linkweb.cn/js"
messageurl[2]="http://linkweb.cn/js"

// the targets of the links
// accepted values are '_blank' or '_top' or '_parent' or '_self'
// or the name of your target-window (for instance 'main')
var messagetarget=new Array()
messagetarget[0]="_blank"
messagetarget[1]="_blank"
messagetarget[2]="_blank"

// the text of your links. In this sample it's the word 'more'
var linktext="去看看"
// font-size
var fntsize=11

// font-color
var fntcolor="FFFF00"

// font-family
var fntfamily="Verdana"

// font-weight: 1 means bold, 0 means normal
var fntweight=0

// standstill of each image(seconds)
var pause=3

var backgroundcolor="444444"

// horizontal position of the slideshow (distance to the left margin of the browser-window, pixels)
var posleft=5

// vertical position of the slideshow (distance to the top margin of the browser-window, pixels)
var postop=5

// width of the textbox (pixels)
var scrollerwidth=200

// height of the textbox (pixels)
var scrollerheight=150

// width of the border (pixels)
var scrollerborder=2

// width of the textpadding (pixels)
var textpadding=15

// do not edit the variables below
var textwidth=scrollerwidth-(2*textpadding)
var textcontent=""
var bgcontent=""
var i_message=0
var i_stepwave=0
var i_maxstepwave=20
pause=pause*1000
if (fntweight==1) {fntweight="700"}
else {fntweight="100"}

function initiate() {
gettextcontent()
getbgcontent()
if (document.all) {
wavemessage.innerHTML=textcontent
wavemessagebg.innerHTML=bgcontent
wavemessagebg.style.posLeft=posleft
wavemessagebg.style.posTop=postop
wavemessage.style.posLeft=posleft+textpadding
wavemessage.style.posTop=postop+textpadding
enlargewave()
}
if (document.layers) {
document.wavemessage.left=posleft+textpadding
document.wavemessage.top=postop+textpadding
document.wavemessagebg.document.write(bgcontent)
document.wavemessagebg.document.close()
document.wavemessagebg.left=posleft
document.wavemessagebg.top=postop
changemessage()
}
}

function enlargewave() {
if (i_stepwave<=i_maxstepwave) {
wavemessage.filters.wave.phase=i_stepwave
wavemessage.filters.wave.strength=i_stepwave
wavemessage.filters.wave.lightstrength=i_stepwave
wavemessage.filters.wave.freq=i_stepwave
i_stepwave++
var timer=setTimeout("enlargewave()",50)
}
else {
clearTimeout(timer)
changemessage()
}
}

function reducewave() {
if (i_stepwave>0) {
wavemessage.filters.wave.phase=i_stepwave
wavemessage.filters.wave.strength=i_stepwave
wavemessage.filters.wave.lightstrength=i_stepwave
wavemessage.filters.wave.freq=i_stepwave
i_stepwave--
var timer=setTimeout("reducewave()",50)
}
else {
clearTimeout(timer)
var timer=setTimeout("enlargewave()",pause)
}
}

function changemessage() {
i_message++
if (i_message>=message.length) {i_message=0}
gettextcontent()

if (document.all) {
wavemessage.innerHTML=textcontent
reducewave()
}

if (document.layers) {
document.wavemessage.document.write(textcontent)
document.wavemessage.document.close()
var timer=setTimeout("changemessage()",pause)
}

}

function gettextcontent() {
textcontent="<span style='font-size:"+fntsize+"pt;font-family:"+fntfamily+";font-weight:"+fntweight+";width:"+textwidth+"px'>"
textcontent+="<font color="+fntcolor+">"+message[i_message]+"</font> "
textcontent+="<a href="+messageurl[i_message]+" target="+messagetarget[i_message]+">"
textcontent+="<br><br><font color="+fntcolor+">"+linktext+"</font></a></span>"
}

function getbgcontent() {
bgcontent="<table width="+scrollerwidth+" height="+scrollerheight+" border="+scrollerborder+"><tr><td bgcolor="+backgroundcolor+">&nbsp;</td></tr></table>"
}

// - End of JavaScript - -->
</script>
<div id="wavemessagebg" style="POSITION: absolute"></div><div
id="wavemessage" style="FILTER: wave(); POSITION: absolute"></div><div
id="deletethisblock" style="LEFT: 220px; POSITION: absolute; TOP: 5px"></div>

</body>
</html>

预览效果

天猫商城    聚划算    天猫电器城    淘宝旅行    天猫超市    淘宝游戏    天猫品牌特卖    天猫母婴

我要评论
  • 匿名发表
  • [添加到收藏夹]
  • 发表评论:(匿名发表无需登录,已登录用户可直接发表。) 登录状态:未登录
最新评论
所有评论[0]
    暂无已审核评论!

全站链接: 
收录查询
分享按钮