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

|
网页之跑马灯文字特效
//修改宽度5 g! f6 @, d" P; U( r f- u3 \
var marqueewidth=300# w0 h7 X0 M* O' o9 W! }$ O3 ~
//高度$ f0 v( O/ @/ Y3 b4 T
var marqueeheight=25; [/ S7 u8 F: n& A
//速度(1-10)
% p# Y# N* A' V9 \( b" g Zvar marqueespeed=3$ ]: ?3 {, N( V5 z# ?# D
//背景颜色- \0 u9 }/ l% `, ?2 v
var marqueebgcolor="#FFFFFF"! c/ B B4 G9 |5 ^ z2 e" l
//是否能暂停 (0=no. 1=yes)?
* H$ z% P- \" _var pauseit=11 X, R. r Y X7 @3 Q L9 F* T
& O% }# S8 Y7 B8 g8 f//修改显示内容- Q) D7 F( e5 ]
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ x" Y2 S) D8 T! x( D& J3 N4 D, v7 s( X" y" d3 J
, N1 E- q5 Q4 B
////下面不需改变////////////
' v( p2 \7 I, K5 x
* H: W; R2 H) }7 p8 W! k5 A! rvar copyspeed=marqueespeed& G+ F v: c) f( T5 V Q7 G- p
var pausespeed=(pauseit==0)? copyspeed: 0+ W: z h! g+ |, f; r5 H
var iedom=document.all||document.getElementById R% i! S, U9 q7 @
if (iedom)9 c: w/ E" ]- c, v5 v- h
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')0 Q) ~* F- e3 A7 D w2 S$ W& @" e
var actualwidth=''
1 I/ V; w; ]$ ?9 G0 ~var cross_marquee, ns_marquee
+ x1 l- x$ I! ~- s* M: n
1 r7 W1 n* d5 N% K# rfunction populate(){
, F3 W3 u% e. {) e! q4 `if (iedom){0 T9 y1 _" L4 C, [# M4 x, m
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee) R# m% j7 `% I9 E! ~
cross_marquee.style.left=marqueewidth+8
4 [: e5 f }; a6 s" @cross_marquee.innerHTML=marqueecontent
# _( y" |7 f |actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth" F) ]) u9 a+ d4 w& J& E
}
, [2 z. F, B: f6 F6 g1 H& _4 gelse if (document.layers){! G" D5 d4 [+ a Y& s7 u7 Q0 X
ns_marquee=document.ns_marquee.document.ns_marquee2: j2 v- G- Q9 x& h2 w4 F
ns_marquee.left=marqueewidth+8
4 K: w/ I x7 {$ d" Zns_marquee.document.write(marqueecontent)2 Q7 t- C* L, d2 l
ns_marquee.document.close()
- S6 k& e) q- r% K2 A, F2 R% Xactualwidth=ns_marquee.document.width
+ S% |( \2 x9 X6 \; a' y}
# s _3 B0 T, |1 K* s: Plefttime=setInterval("scrollmarquee()",20)
& F m' e( }) z- @1 _6 x5 m2 N2 h}, {! Z5 x3 w3 |& |+ |
window.onload=populate8 w, N1 y' ?9 r$ E$ X9 y6 ?& ]
) G, T( N" E+ a2 [ F N9 Xfunction scrollmarquee(){* Y3 u( @+ o, A* L0 s/ [
if (iedom){+ |$ i1 }" A$ z: H B
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 d$ P0 D b, ?9 d
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
) o* u1 G1 Q$ F' M' felse# e& x) \0 Q; h- J* [1 ~
cross_marquee.style.left=marqueewidth+8
6 ?: @2 A8 L9 s; d" u- r9 ] M
\, b/ b, I% d}1 j% n% p3 G) E: t# O
else if (document.layers){ A% \4 V8 T( T) M! z
if (ns_marquee.left>(actualwidth*(-1)+8))
3 X$ M3 y, u3 {3 N1 \/ Lns_marquee.left-=copyspeed; `, I; A0 y0 U3 {7 _- H! \
else
2 Y. w4 g1 J) A8 Z$ I$ Vns_marquee.left=marqueewidth+8* b7 E V5 T; E! G w
} n: \: H7 s& [: m6 Z; _' ]
}, {% z# @. F: A F
; }, w4 a' M, e& Mif (iedom||document.layers){
: k# Q! l1 J* g/ s3 qwith (document){
$ u2 q% G! b! e9 pdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')3 E/ k2 w2 G& x7 e
if (iedom){
1 v' y2 J8 a6 g3 l" @- T" _( Owrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')- m9 V' E/ n8 w s h% ]# V
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
6 ?, d x9 M" q+ D) [ z# Q) owrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')! X( V4 \* x# P6 H2 Q6 B3 i
write('</div>')
" F, P" T# F7 V7 V5 I}
; p/ R% a1 E* `% i( telse if (document.layers){7 M9 a2 ? w+ [4 o
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
; d' I: p `% p- ?/ kwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
# V3 t5 q/ w& m3 W' x9 r5 Rwrite('</ilayer>')
! @7 S }( s) a3 x}
, A: O' }6 J0 M( v0 }" x7 {0 R tdocument.write('</td></table>')
) S; P! S F0 Z9 C$ _}
; \( l0 n8 _( s1 T* _0 A}
' b& x8 m" W& U0 F$ }</script> |
|