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

|
网页之跑马灯文字特效
//修改宽度
( `) v2 [# o$ c3 fvar marqueewidth=3006 r9 O C+ C: I# m5 N9 H. z
//高度. P7 `- n! A! A; Q4 V: r
var marqueeheight=25
3 b+ ^# F$ h, @2 V//速度(1-10)9 Q7 q Y4 v# \2 v& O! ^* }4 k
var marqueespeed=3
& p) b3 c# N5 p2 O& ^' w//背景颜色2 K; y# |. Z- C% C# q
var marqueebgcolor="#FFFFFF"
7 W6 O' J1 T+ v" N l+ w0 s//是否能暂停 (0=no. 1=yes)?2 D9 b# w) h2 r
var pauseit=1
# [ G6 W4 i l/ U5 ?! _9 {) J2 C' Q5 ^, I2 x/ `$ I
//修改显示内容
+ ?0 x, k9 O* _! E8 P: zvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
. E; n, O! g2 k9 E
`% I/ V/ a. o$ i$ J1 k
& F& y1 w, ~- P% ^8 R: L////下面不需改变////////////
; x4 r! E3 |7 D" ]( i! z4 b4 ^; A5 d( Z3 C, j) w1 z/ ?; E
var copyspeed=marqueespeed
! D8 K& ?- E" e5 }/ vvar pausespeed=(pauseit==0)? copyspeed: 0
; }4 T- e% { E+ C' T2 Y0 Yvar iedom=document.all||document.getElementById. u s' K' D: t! F" A, g8 I' N
if (iedom)
1 y# l, Z0 c3 M/ idocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')$ p U+ T" Y6 z! l9 L
var actualwidth=''
5 u1 d) N$ M P) V. hvar cross_marquee, ns_marquee% M7 t. h' w, z5 u; j+ D# _- A5 H
. X$ }1 C& h( O! H+ b
function populate(){
- t# b. g( S# V. kif (iedom){
$ E- C; r5 \0 O) a# l. gcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
. L( S& y9 b/ a. h' d( S0 Lcross_marquee.style.left=marqueewidth+80 Y7 J' B; p$ O5 V' v
cross_marquee.innerHTML=marqueecontent
@" @ q9 I" y7 Y2 F7 eactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
( l4 S1 L, | t y e) R}4 V# k# a) t) |4 M( r) u v$ ` t) u
else if (document.layers){
* U0 f: U8 V4 ~ns_marquee=document.ns_marquee.document.ns_marquee2
$ Z6 p) b1 t$ ^" z$ Qns_marquee.left=marqueewidth+83 ^% J: l- C9 s8 I/ m
ns_marquee.document.write(marqueecontent)$ K* n' g% @5 @4 }
ns_marquee.document.close()% U) j6 M' @: B7 T# a7 I2 K
actualwidth=ns_marquee.document.width
4 i) R% ]7 p: ^9 h6 a% B$ X}9 w! D& }! u% m" F/ @! F( T* n
lefttime=setInterval("scrollmarquee()",20)
- w$ B b! u8 Y0 Q" D2 d# f}
! k" A* ?* N0 N' a" o3 Pwindow.onload=populate7 g |6 v1 Z; _( X* e- {0 ?
: l8 _5 |6 Q( M. q4 mfunction scrollmarquee(){
: v% i) L! y. O) y9 a5 |4 b Tif (iedom){
3 B' K! D" K8 f& j0 l u3 Z3 Cif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))2 k9 M% k8 X9 _. E4 V! ?9 d* n; P
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
! n ]- G# g5 I: K+ `4 n6 qelse$ d7 _5 n9 ], j {. b3 ^/ |
cross_marquee.style.left=marqueewidth+8
7 h7 K; P8 F" s% ~1 R. Y
# ?7 V' ? M; N, i, l}
( G! @1 K' N3 |- v$ X# [* Belse if (document.layers){
; ^5 R& T/ P; p5 J- v- W1 ]if (ns_marquee.left>(actualwidth*(-1)+8)); u$ R- u \: O& i5 B! K5 k; Q) g
ns_marquee.left-=copyspeed
7 B' @# x+ w& A+ w) {else* Q2 k: Z6 ]. h- O; S: i
ns_marquee.left=marqueewidth+8
; Y$ R* o O/ ?}, I5 p& C) {8 l$ G- i2 s
}" Q9 p. O7 E5 f
' J o0 V) a) M* i& L* cif (iedom||document.layers){# j" f* `9 d9 l& i
with (document){, A; k' \8 Q# S) ^3 }
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
$ N# V0 ^4 p- H9 m" ]if (iedom){, U7 o3 m3 m3 @, t5 s. \
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
) y( q* h$ O) h9 B' Gwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'). ^! ?* b( g5 R6 Y; G- J# d( s, o
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')5 P- {( L3 y- G4 X
write('</div>')
# a& S, V7 Y: v+ C6 |/ q}1 {) y1 t2 i" G5 X
else if (document.layers){1 ]' |6 t" G, h6 B% O
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
3 o: c4 {6 s2 k7 |1 f% b! iwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')( F$ A" {( j5 c, o- c
write('</ilayer>')2 w: D& l; {! N. Q- R* Z
}
8 J% J; I5 O/ @0 _1 S7 ddocument.write('</td></table>')1 u3 W0 ]/ y% c5 r% ]+ o! k
}
* N0 i3 G8 ^. Q" c# J}; [" Q" D) j* t0 n7 K
</script> |
|