左右移動的跑馬燈語法
感謝~ kitty琴 ~提供語法唷~左右移動的跑馬燈語法..
----------------------------------------
我問kitty琴..左右移動的跑馬燈語法..
轉自kitty琴的"留言" kitty琴於2008/03/09 20:32回覆
(要放在自訂欄位的左右移動跑馬燈狀態)
-------------------------開始介紹語法-------------------------
<script language="Javascript">
var x = 0
var speed = 100
var text = " 歡迎光臨最愛kitty滴琴~這有kitty商品、自製kitty網路素材等等 "
var course = 127
var text2 = text
function Scrollforward() {
window.status = text2.substring(0, text2.length)
if (course < text2.length) {
setTimeout("Scrollback()", speed)
}
else {
text2 = " " + text2
setTimeout("Scrollforward()", speed);
}
}
function Scrollback() {
window.status = text2.substring(x, text2.length)
if (text2.length - x == text.length) {
text2 = text
x = 0
setTimeout("Scrollforward()", speed);
}
else {
x++
setTimeout("Scrollback()", speed);
}
}
Scrollforward()
</script>
留言列表