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

|
网页之跑马灯文字特效
//修改宽度1 x8 Y; ^+ ?4 x% S
var marqueewidth=300. T* b2 ^, D4 j6 V
//高度
# K# O0 p U& e/ a* ivar marqueeheight=255 O/ q6 Y4 N: S; x, j g1 |, l* M
//速度(1-10)
& C1 V6 G, V, @' v" X& W" Mvar marqueespeed=32 s7 t0 d2 v- A
//背景颜色; z; z: x* h- [
var marqueebgcolor="#FFFFFF"
$ J: A2 V4 O, r. D' S' X# R z//是否能暂停 (0=no. 1=yes)?9 x4 R( h( M7 T" A2 A7 V
var pauseit=1* e% F: t3 C% |
. R6 ~/ h! s; X, n
//修改显示内容8 R1 v5 o7 e# ]$ X
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
- O9 n" K. C3 s% U0 z* J( u- Q; m) z2 }" K4 B9 k( U
" ?5 C H. E; y) C4 L- I( h////下面不需改变////////////
' k2 m5 X1 I7 k4 H( J- ]
9 z' v1 T: e( a, }6 ?var copyspeed=marqueespeed7 X+ o' ?! V' F/ v
var pausespeed=(pauseit==0)? copyspeed: 04 W- T* P% U( V( c. \
var iedom=document.all||document.getElementById; C$ Z: u2 R8 k! |3 t: I
if (iedom)0 J2 {% C; n& c, k6 H2 L# E
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')3 F$ |9 j( L6 \; P, T
var actualwidth=''
; k+ b' l" X2 Q. W) tvar cross_marquee, ns_marquee
4 R1 w9 w4 M+ l
9 M0 W! j# Y7 k. M9 `, o- d9 @: ?3 `function populate(){
3 Q0 e; s& y* S, ?if (iedom){8 h. c- H/ K7 T% T+ C: D- M
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
4 E5 G3 }) T+ z. O2 ?& j6 q9 H# Zcross_marquee.style.left=marqueewidth+8
% r: c- h9 }0 D4 f" [/ T. ]- jcross_marquee.innerHTML=marqueecontent
: y: i2 T! K3 O; ]& a1 b# kactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
0 d' k# I: D3 R- M8 w( D}- U$ b/ J! T5 T% t7 F
else if (document.layers){
! l8 }% u/ n+ t% w& S) Mns_marquee=document.ns_marquee.document.ns_marquee2' o/ i( J1 j$ s9 W
ns_marquee.left=marqueewidth+8
) \4 X* d" {. [( C5 wns_marquee.document.write(marqueecontent)+ {5 R" x) e+ l/ o
ns_marquee.document.close()/ ^) c" Z" b3 g- ^ d5 I7 s
actualwidth=ns_marquee.document.width8 X* o' z2 v" [, m5 p! m
}7 U5 f2 e: u( P' ~4 J2 N& {! i
lefttime=setInterval("scrollmarquee()",20) ]: K5 X7 G& E# L) d! a
}# X) \5 U6 Y: ?0 b R/ v0 J! J
window.onload=populate- c& f$ E8 y$ j- p" |) T; a# b
# w2 H- h5 N) d0 z9 A4 f; s5 \9 Jfunction scrollmarquee(){( |2 ^- J/ {+ I. i
if (iedom){% W* g) b" b% J$ s, P& v
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))/ |1 P" S9 k1 Z7 n$ a9 q- C) i
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed" v2 p* e/ b$ f3 S
else
% H6 ]/ y5 V) B2 ~' P9 ?6 @cross_marquee.style.left=marqueewidth+8
; E! b2 \$ i# s; b+ \$ y: l5 h$ `; S- p9 ~; B
}
+ {4 P( v, z/ ]% I) ~, G/ U% g! }else if (document.layers){
8 W' F& B. ?. |. rif (ns_marquee.left>(actualwidth*(-1)+8))3 S" R# @" v0 w5 Z/ l- \- w$ L
ns_marquee.left-=copyspeed7 w* _( L' n* A4 R+ p* d# J" ]
else! u- Z4 j0 Y3 T, E
ns_marquee.left=marqueewidth+8
" E: Y7 [8 ~5 ?. ~4 E}
! \- z. y+ q. h! j; ^}0 y+ C1 w. t7 Z6 h: X/ p
$ ~3 a( D Y3 z4 }7 N+ |# Aif (iedom||document.layers){5 {& i0 x$ b! p# S0 S
with (document){
# a/ q# _* ^2 i' s% s+ qdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
% p6 }$ S+ u: n. W8 f6 ?, e9 U; Gif (iedom){
1 I& S! p. r- L/ J0 w4 {6 ?' ~write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')0 ^ y5 w' H+ D
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')- s3 \/ I0 L' e6 V2 y7 C6 v9 [
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')/ [# Q) w5 E8 C1 J
write('</div>')
! S: b0 H# T" T, U7 ^& v2 t, }}1 J% R+ U" Q5 Y+ z/ L u) J
else if (document.layers){
: I* d, u! i, Q0 r/ t m; o) F& {- V% ?write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')0 l5 k# G$ p5 m0 Q
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
# o- s V8 d! T$ g2 owrite('</ilayer>')$ V( h) d' t( e' D5 O7 K, k! P _
}4 K/ a/ S$ Z2 C/ Q, |: R! @; \
document.write('</td></table>')
6 |! Z9 O5 v u& ?" A}
; G( L& K5 Z/ h8 X* J}, s ~ W+ |. |3 g
</script> |
|