特效三:title弹出效果
把如下代码加入《 head》区域中
《 script language=“javascript”》
《 !-- Hide me
var index_count = 0;
var title_string = “欢迎光临这里有许多电脑应用方面的文章
,是您学习电脑的好去处!希望您能够常来!”;
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》
特效四:文字组合弹出
第一步:把如下代码加入《 head》区域中
《 script language=“javascript”》
《 !-- Hide this script from old browsers --
var speed = 10
var pause = 1500
var timerID = null
var bannerRunning = false
var ar = new Array()
ar[0] = “欢迎来到多特网!”
ar[1] = “它是您学校电脑的好帮手!”
ar[2] = “请多提意见,谢谢! ”
var message = 0
var state = “”
clearState()
function stopBanner() {
if (bannerRunning)
clearTimeout(timerID)
bannerRunning = false
}
function startBanner() {
stopBanner()
showBanner()
}
function clearState() {
state = “”
for (var i = 0; i 《 ar[message].length; ++i) {
state += “0”
}
}
function showBanner() {
if (getString()) {
message++
if (ar.length 《 = message)
message = 0
clearState()
timerID = setTimeout(“showBanner()”, pause)
bannerRunning = true
} else {
var str = “”
for (var j = 0; j 《 state.length; ++j) {
str += (state.charAt(j) == “1”) ? ar[message].charAt(j) : “ ”
}
window.status = str
timerID = setTimeout(“showBanner()”, speed)
bannerRunning = true
}
}
function getString() {
var full = true
for (var j = 0; j 《 state.length; ++j) {
if (state.charAt(j) == 0)
full = false
}
if (full)
return true
while (1) {
var num = getRandom(ar[message].length)
if (state.charAt(num) == “0”)
break
}
state = state.substring(0, num) + “1” + state.substring(num + 1, state.length)
return false
}
function getRandom(max) {
return Math.round((max - 1) * Math.random())
}
// -- End Hiding Here --》
《 /script》