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

|
网页之跑马灯文字特效
//修改宽度4 G0 _/ \$ K# e! G8 ~
var marqueewidth=300
; k/ d, |8 p& @2 C. ~//高度
( ?3 j1 V% P: _- ~; L# Evar marqueeheight=25
) y5 W4 ~: F( o- T# o//速度(1-10)9 Y# T" L# q2 j6 `6 W R
var marqueespeed=3
% {5 |. c4 }# A; T3 G//背景颜色
* T0 r& G0 j# j/ q9 v& P, b+ @0 vvar marqueebgcolor="#FFFFFF"
: x5 a/ d# T8 _//是否能暂停 (0=no. 1=yes)?
* {: S# Z+ w& | n' jvar pauseit=10 g, e4 u% o0 l- q/ F4 W8 [/ d+ a
/ t" ]2 m8 t# Y# Q e//修改显示内容1 d0 v" A6 ~% \; E, G5 r' j9 Q" i
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'$ c7 n( Q2 j& `9 O
" Y% t1 P, j- W7 J1 Q
, N) ~7 B7 u* V2 y7 b////下面不需改变////////////+ u C& }, ~; Y: @0 g6 j
" J' f3 k. x6 M
var copyspeed=marqueespeed
6 \0 A7 x- q; V2 ]var pausespeed=(pauseit==0)? copyspeed: 0
) l- \' A& u8 A7 P/ l* lvar iedom=document.all||document.getElementById. f; e8 A. u; T& g
if (iedom)
7 f$ k) w1 S$ l* H5 R+ @document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
. x5 y: N" u! Zvar actualwidth='': s, x% P% d. Q( d/ e8 Z0 Y
var cross_marquee, ns_marquee
% |% |- O% y- w5 c7 r& g, x7 K# b8 s( f: w' U
function populate(){
3 ~1 S: F, I/ g- jif (iedom){
9 i1 w- i( s, D4 jcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
% {" [' ?( J: {cross_marquee.style.left=marqueewidth+8' m3 I" w4 F* h" A6 u! \4 y( h
cross_marquee.innerHTML=marqueecontent
/ y* @* A" R' M8 C( Uactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth1 w: T5 s, w7 |9 h- W* j
}
, c5 @6 R2 U4 V' _! qelse if (document.layers){
9 T: u" t. P Y. X3 Xns_marquee=document.ns_marquee.document.ns_marquee2+ O4 W& W" t$ b( M9 Y% N' U& F
ns_marquee.left=marqueewidth+82 W; z* e$ K" ]9 W N8 t/ F& b9 E" _
ns_marquee.document.write(marqueecontent)
9 ]3 o8 d7 b: F' |ns_marquee.document.close()3 F; O- S' @/ {5 K2 C+ I" t7 Y
actualwidth=ns_marquee.document.width6 ^1 t! a5 C% y' K; Q3 W
}
1 S+ i6 @9 M* J: q5 p7 Z k2 \. H( l/ R% dlefttime=setInterval("scrollmarquee()",20)# s1 G& j1 ]* k
}9 _2 O3 r) x' K1 j2 F, @
window.onload=populate7 t! A9 ?: `1 @3 M/ z& d5 s+ o, b
p3 A2 l5 P0 n8 S7 V% N* P
function scrollmarquee(){
5 P5 \$ l% p# K' I4 L% O, [if (iedom){
7 B" P+ \2 l& k7 x3 aif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
% L+ I: }- h. l. d# Xcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed' y1 n; @; A: x z! M3 g
else
, ?! B# K0 R* Y+ N& Q- Scross_marquee.style.left=marqueewidth+8
- I; T4 |. c* }) T) |/ y
7 i7 E! e9 Z# }% U}2 w+ v4 {& h9 S m6 q4 T
else if (document.layers){
" G1 e7 c% Q9 _if (ns_marquee.left>(actualwidth*(-1)+8))
) S( K2 b& J' k& w6 C4 _ns_marquee.left-=copyspeed
) C% ]- S* ^1 u; Z, W0 J7 h% R0 Yelse
7 L/ T# ? P* Y8 V6 v( x' r cns_marquee.left=marqueewidth+8
z% N- x9 m/ e7 i}% C$ W& b. C4 ^; ~
}
) c4 Z/ g* l7 U" E1 Z. C' ^1 @2 |) s% K
if (iedom||document.layers){
. T+ I( {! O# {7 Dwith (document){
/ ?' _9 ~3 C5 x D- K, A3 tdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
U% G, @% G J7 E- s2 dif (iedom){
! |4 H, {$ a9 K0 [, x! Swrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
0 H; V3 _$ X9 s2 L0 ~write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
( z7 o' U8 ~" D5 w4 swrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
8 r7 S& \' g* X/ H0 y( Ewrite('</div>')
( C# K! s/ K p. ^}6 ?/ q5 s6 v% q- i2 x9 Z9 k- f
else if (document.layers){
2 `3 I2 s. g; r, ~write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')6 z3 \- T1 z: A5 z
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')% C3 X5 z# n7 W- D# L' r+ b
write('</ilayer>')7 F% x7 p9 a/ p4 ~" G7 ?) C$ S0 `
}
) @7 E, \4 k4 ~( p4 jdocument.write('</td></table>')/ v1 S F4 ` I1 w( a
}
( k* C3 |1 j1 _3 ?8 S) p; f, ?}
7 F; E2 z+ m2 F2 d4 q</script> |
|