返回列表 发帖

网页之跑马灯文字特效

//修改宽度
2 t1 f1 a9 c! }$ F3 M0 a9 tvar marqueewidth=300/ C% U+ t9 W+ v2 H
//高度. W. T  w6 ]. A* l: n  I
var marqueeheight=25
" n! h. g' J# B- P3 o+ O- e//速度(1-10)& L, M9 F. ~/ c9 U4 g6 S3 G
var marqueespeed=34 w1 l5 O3 w( }) e
//背景颜色3 h9 G# Q' }  o: `, l) p
var marqueebgcolor="#FFFFFF"# [! T3 D+ h, N7 g% \
//是否能暂停 (0=no. 1=yes)?; a4 s6 I6 @8 t2 A. ?7 m
var pauseit=1
. r: R  }5 A# y! P* U3 V6 a# C, _2 w% E- H( T% x3 I
//修改显示内容
$ X& F! ?7 U& P4 c! Ovar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'% A0 s' m; N$ g1 D, z8 h" C
1 y+ i8 J( Z% y

# c  q% w+ M- N! G1 t) E" j////下面不需改变////////////
) o( G5 @! k# x  l
' {; m+ O0 ~3 }9 m' T- N! g6 Q0 cvar copyspeed=marqueespeed
) L6 P' F2 H! o$ k1 D# c% W1 Wvar pausespeed=(pauseit==0)? copyspeed: 0/ R# V1 y  ]. R  Z
var iedom=document.all||document.getElementById$ t) x& c. B' H6 e" y
if (iedom)& m6 M/ p% t( i
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
. k) N. E9 p7 q  E; N; |var actualwidth=''
; W# P( e, \8 |! c. l. vvar cross_marquee, ns_marquee( l2 e" I8 p1 `6 q6 R* J$ [

- C- o2 W- E" k! G5 Y+ gfunction populate(){
- G& C) `+ m& D$ ]  N) V! y1 y6 [if (iedom){
, ^; V( F) |3 F! i6 h+ lcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
8 R/ R# _4 `! j% ~4 ~! J- s8 Jcross_marquee.style.left=marqueewidth+87 E4 B  d" |! ]4 ]* E" z; Q, o
cross_marquee.innerHTML=marqueecontent0 u  `. R& G6 K" f( O
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth2 I- L! a3 E( }  O+ a- o- M. A. }3 a
}9 g7 M& Q9 B8 s/ X5 l: E
else if (document.layers){
- u7 x' B- ^1 P0 i0 P& g! Qns_marquee=document.ns_marquee.document.ns_marquee2
( K% }: [$ o9 R) }9 t, r- yns_marquee.left=marqueewidth+8
+ s* z, H% {' x: M: m3 }4 mns_marquee.document.write(marqueecontent)
0 j3 c) x( _; @1 D! |ns_marquee.document.close()6 Y4 a+ z# q1 P- z9 U3 h# W
actualwidth=ns_marquee.document.width
8 U5 u5 }; H" L" W* r+ ?}
: ^, ~5 ?* \2 N+ O( E  Flefttime=setInterval("scrollmarquee()",20)
# H! |) ]2 X& {}
% u" T9 x: C0 dwindow.onload=populate
* M) G1 U! y$ B# ?2 `7 t. r. z3 Y8 l
function scrollmarquee(){; [2 i& f  W6 c' K  K# A! {# M0 Q
if (iedom){
7 b, U. h4 Q6 n$ a3 V3 Wif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
8 r1 v( d& U! N" Tcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
/ p$ a, E' [8 s4 \. |# zelse" K- W! E: D7 h
cross_marquee.style.left=marqueewidth+8
$ i; h% B) u* s
5 ]+ o7 g% h5 M/ n  R, g# j% D' _0 w}
0 F! M# S+ i7 L2 g" qelse if (document.layers){* I0 M8 ~; B! {7 T. @$ ]% i, u# b
if (ns_marquee.left>(actualwidth*(-1)+8))
: G7 Y/ X" x& uns_marquee.left-=copyspeed
+ \& N) J4 Y' e) O2 gelse
2 f2 \$ f; }. J7 \% s" Qns_marquee.left=marqueewidth+8
( `3 K2 D; i6 L- g& P% t}
, e& K% ]! W9 \" O  x}
( _( N' N( L. h1 k8 m) y7 L) v" d" e, `, i* ]* s' ]
if (iedom||document.layers){
8 R) j+ U& |$ Y# m2 d$ r4 S8 mwith (document){( p* S( w5 c% K# r
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')- e9 ~. c# v0 S1 b9 W! m
if (iedom){
" `0 G  i# c1 v: c$ W# m. Rwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
: m) y3 B; m/ ~/ \5 Z/ jwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')1 E5 L8 w+ h; I) L/ t* T7 {
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')8 B+ V3 |/ C1 B' y# U3 i' B7 S$ ^- r
write('</div>')
1 n, ?7 v5 M6 t1 I7 W$ l3 d}
* P/ c3 r3 W5 g0 @) Gelse if (document.layers){
* E# C( n( B9 j" R% n0 d; [write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
: u  c3 f" i7 L; Q: w2 jwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
2 w! l4 Z1 R0 i) `* n' M2 ]write('</ilayer>')
) T, c$ T9 o1 L- N}0 }' V0 G  R: d& K! W
document.write('</td></table>')
  M& K6 E0 K$ R% `0 G}
. A7 b+ v3 I$ H5 X}- K5 ~* {1 O  \- [8 z
</script>

返回列表
【捌玖网络】已经运行: