|
  
- UID
- 133
- 帖子
- 51
- 精华
- 1
- 积分
- 186
- 金币
- 55
- 威望
- 2
- 贡献
- 0

|
网页之跑马灯文字特效
//修改宽度) M2 y. r* v" x, t; Y2 s6 R
var marqueewidth=300. }1 x3 Y! q5 x% V
//高度, R- _. j+ I3 v$ C2 R' u
var marqueeheight=25; s3 ^$ E$ c$ a" x! o& [' s6 |
//速度(1-10)
. B0 F9 u$ F$ e! Pvar marqueespeed=39 h. I; D+ W8 f8 A
//背景颜色+ K8 ~# X2 N, q* b2 p- A
var marqueebgcolor="#FFFFFF"
: q+ @9 s# T6 Q, L" a//是否能暂停 (0=no. 1=yes)?
8 L8 ~7 g! \9 U9 @/ g9 P. o, }var pauseit=1 f; b: f. U( r0 B% O2 |2 y4 T) P
4 B9 {* b" Q1 d/ @ ]
//修改显示内容
5 _) Z+ w) `7 {# ovar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
& ?' }/ z0 W; F/ X( O. d9 c/ Q) c1 v( @0 B
% I N+ |5 D& R; I, D////下面不需改变////////////
* g* j' u0 ]5 r- B
3 Q: u4 Y0 @' p' S$ {/ rvar copyspeed=marqueespeed
# r6 }/ D# k3 i7 U2 ?$ ]" avar pausespeed=(pauseit==0)? copyspeed: 06 b6 G/ y7 ]& O4 f
var iedom=document.all||document.getElementById: q9 S" _ y; c" O' c X
if (iedom)* ~+ u( c+ b Z2 Z5 N
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
9 U0 X$ u$ W4 U5 W4 Nvar actualwidth=''/ E( q! G/ X( y( _$ D1 ^; n1 H
var cross_marquee, ns_marquee
2 D7 A4 `, h3 ~- H2 H1 K8 o5 R) t& p( d$ }# W
function populate(){
0 o/ F6 J; }7 Y8 ?if (iedom){1 F' v Y) o6 M" ^8 A5 P& t
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee0 P+ b# [* h+ \- K0 m# l" \8 v/ x
cross_marquee.style.left=marqueewidth+8
/ P+ q* r. ]* ~9 h, \cross_marquee.innerHTML=marqueecontent6 T! S/ F' }( W+ c
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
$ U! R7 ? C. @3 }}4 R/ m, |( |+ g; h k8 {5 l# Q$ q
else if (document.layers){
0 W/ T7 ~8 ?+ @# h9 @! u1 i. mns_marquee=document.ns_marquee.document.ns_marquee2 {; P0 R) j, s' I S7 s. Y
ns_marquee.left=marqueewidth+8" W' K, E, }% R2 Q( T9 N9 z L6 Y
ns_marquee.document.write(marqueecontent)
0 }5 C$ C: {0 v5 U7 ]9 ]9 S4 Vns_marquee.document.close()/ `* X9 P2 \( c! s3 {
actualwidth=ns_marquee.document.width
. I. \4 j2 W2 A) D% j}
" U& p, O( V; @6 Rlefttime=setInterval("scrollmarquee()",20)) g a6 Q" i, o& @' i# U' d
}3 s% C& D$ o! y c) G
window.onload=populate; V2 k l2 r2 @$ {: t; v1 _
' j$ L! }' A' X
function scrollmarquee(){
) o! T: _4 |/ w5 \, {( R; ^( Qif (iedom){" r+ C$ _& S% t9 K# }
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
0 e8 H! b# S: jcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
- x4 v4 j& M% _6 W2 N, Y- Relse4 R$ \7 ]5 O) \ M0 Y
cross_marquee.style.left=marqueewidth+8
( @' l! T1 V3 ^1 g2 t- [0 h, w; [: m
5 M- J M* o; m5 @}
+ n4 ^8 t7 j# aelse if (document.layers){
3 x! n5 {- f7 ~9 _4 R% kif (ns_marquee.left>(actualwidth*(-1)+8))
% e; P. s3 ?- ~; ?/ ans_marquee.left-=copyspeed U* C- k# }$ b; W) ]% p3 I, D. x
else2 I* R2 P5 L; H, l4 A7 p
ns_marquee.left=marqueewidth+8
, x. d" x9 D% @/ s2 x}' U: Y+ C8 R' J" F6 [
}
- |' ^4 ]; C1 @' d9 ^- }* a1 c, }* ~7 v6 U, V* q
if (iedom||document.layers){8 p: T8 E8 R1 x( H
with (document){! M |4 ]( W! R- E2 [ _
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
& b3 P6 E( V5 n9 R4 T* g! fif (iedom){
5 y/ }3 M2 s x5 rwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
. Q% B4 m) e' swrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')9 F5 H/ y) |8 ]% v( q! i) d
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 u$ H; E# L3 _7 ~# Vwrite('</div>')
4 l. [/ A( Z v- L' u}
% M" L. }' _9 A: u* |! ^else if (document.layers){1 r' `9 E8 U3 }
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
$ D+ Q6 {/ a0 F7 Q' k& ?write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')4 h6 B: T& F7 s
write('</ilayer>')
' d. h0 o k. N+ g}& I0 z. W' J0 }0 \4 K+ ^
document.write('</td></table>')& x% E6 Y l1 A) i# @( a
}# _! j+ o/ q8 b0 T' h% {- Y; L
}
/ f3 B( Y& v8 d5 {$ d</script> |
|