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

|
网页之跑马灯文字特效
//修改宽度& @2 q, x L' G* \5 P; w* @8 V- I
var marqueewidth=300
7 G' `& G# e( Q4 q8 e3 F# a//高度
1 z3 n( h+ s% k& P. O; Avar marqueeheight=250 M4 r9 I7 _. ]
//速度(1-10). C' S: w. E/ s5 @# R
var marqueespeed=3
6 {( A+ m1 t; V1 N$ @9 i. s//背景颜色+ C0 j6 R4 z/ F- |% U" i! F
var marqueebgcolor="#FFFFFF"$ g4 E1 W, [6 p/ p
//是否能暂停 (0=no. 1=yes)?+ L% f+ |5 E, S+ B6 c' l
var pauseit=1
8 A( g+ Z6 c: N# d9 d- r- F5 \& R) b
//修改显示内容
# P' S' |! O0 O& Y wvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
; ?# {6 Z4 _ F0 O, }/ e5 x
$ D2 ~% t' T' q! F- A
& C* l- F% N8 o u' L, e" E////下面不需改变////////////# `- h6 D+ l N
, g F" E5 i2 N! L2 `# M
var copyspeed=marqueespeed7 s7 O+ }6 C, B i+ _* q; x; O' n
var pausespeed=(pauseit==0)? copyspeed: 0
W8 n k1 X6 K* p* g) U: l( uvar iedom=document.all||document.getElementById8 }; k& v# L1 _" F" ?3 {: ~ u
if (iedom)
) ]9 u4 q% e1 P6 x" O& Edocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')6 D# f5 O* [2 C8 p
var actualwidth=''- L- T3 D3 }) i# d6 L; M
var cross_marquee, ns_marquee: m3 N7 L( G3 i q8 K t: A# G! d
J4 F0 ]: M, K5 e+ w6 ?; n
function populate(){; b' E( B& A0 N1 x* G% N+ v, A
if (iedom){
8 w- |8 |2 ~" F5 [9 O" }7 q& R7 Vcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee5 l* I! z2 l0 O: K" L
cross_marquee.style.left=marqueewidth+83 b0 H4 n9 u$ J7 F1 ]1 z1 b7 r
cross_marquee.innerHTML=marqueecontent
+ ?# F/ M1 S5 @actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth, V8 }7 R0 w3 ?. T6 d6 [9 g
}3 z% G o3 |; r& k b3 f
else if (document.layers){& u. E! D* p) C" p: |0 j( A
ns_marquee=document.ns_marquee.document.ns_marquee2
, z- @$ c! K9 n$ h; j6 Tns_marquee.left=marqueewidth+8+ T; p- N7 T$ q9 y
ns_marquee.document.write(marqueecontent)- p- N8 f+ A* E
ns_marquee.document.close(); ~+ e1 E! Y4 S5 a, G# i, |
actualwidth=ns_marquee.document.width
0 d# g f# k( h9 r' d& E5 F+ C}
" j% g% O5 R0 V( P+ Ulefttime=setInterval("scrollmarquee()",20)
. P% v- @, m' I2 {+ k: |6 b& N}
* F4 D+ X) M" U8 Y! mwindow.onload=populate
" }9 ^1 C* X: K H" k' j
' G& ^3 z6 p. @/ e4 N$ k1 bfunction scrollmarquee(){& \, n. R2 V+ H1 l3 O2 |
if (iedom){' W4 H4 s- c2 ~! j- W
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
* h& O g n' i4 ncross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
3 J: d3 W' R: r, K9 \2 [# F& Aelse
$ r& ^% j+ H0 \% S% across_marquee.style.left=marqueewidth+8" J9 L5 g3 z$ o
5 |% e8 r9 ?' I- s. ~: n}
" T& a O: U8 \8 e5 `else if (document.layers){2 i' P; R( j- Q
if (ns_marquee.left>(actualwidth*(-1)+8))$ c& J( G" i/ p- _ G6 u) I# _% I8 z
ns_marquee.left-=copyspeed( |4 u( L; D0 N
else
: m; m$ ^* A2 ]3 I' r/ kns_marquee.left=marqueewidth+83 t% }4 R& X" v5 W w
}
! ] G" N3 u! B" @! y7 J: R5 ~+ E2 y}+ l3 R p n3 S2 o/ K7 T1 x ?
/ Y1 N" I0 X. f$ `
if (iedom||document.layers){; L# B- ]6 w2 M! O
with (document){
* F+ r. \! i# Xdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
: ], t: [% _: hif (iedom){3 _+ S8 y* }$ `" I, _% x& s# [
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
, a$ J, I# p$ P& B9 @write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')) t& p) @0 I+ m4 f- ?1 y% ^
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 a' t7 r3 G5 Kwrite('</div>'): Y5 m X3 B. Y8 \
}
& t8 ?3 ]$ `6 |2 x2 P( I* T0 }2 Zelse if (document.layers){
2 T- Q5 V9 G; ]9 K) s/ h" R( Zwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')0 ? q: U. [0 \1 R
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
+ I; P1 Y* p/ @ e( Q8 a% O- K( n, {write('</ilayer>')! \. g p& o/ `
}
2 q6 B8 n1 Q7 jdocument.write('</td></table>')6 Q. ^9 n' f# |5 B( D8 u
}
. ^% ^+ {/ a/ `3 p8 _2 U: E}
, W5 m9 F5 p6 x9 b</script> |
|