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

|
网页之跑马灯文字特效
//修改宽度
* V! H3 M a- Z- g- E+ H Vvar marqueewidth=3001 t: v0 A' \ T
//高度6 {* r* |$ O* m1 L/ ?+ g
var marqueeheight=256 P- U, C: `' F1 I* N( U
//速度(1-10)1 Z7 C0 ^- r* Z' l+ I+ w8 w, P6 s
var marqueespeed=3/ N, d) @0 d( E# O
//背景颜色
, D8 m5 J: {6 b" T! Gvar marqueebgcolor="#FFFFFF"
* A G& B1 J: ?# y4 Y& i//是否能暂停 (0=no. 1=yes)?/ `1 M, e9 F' s! g9 l \/ f: i
var pauseit=14 a. p) L4 ~" P/ z8 \6 h! ^8 \
9 l& e/ x3 ^% u* a- y8 k
//修改显示内容7 e# K6 P. w' h) x( z8 v) e
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
, s5 t4 Q" O5 \$ D5 K o4 M
5 z9 E$ W2 o2 _) E K, P7 N' F& V' O8 l6 K h
////下面不需改变////////////
* o6 l' V0 B' I0 }5 A j& _: U6 d/ |0 }: h1 g# p- g1 B m
var copyspeed=marqueespeed4 A# ^* U% c1 H0 ~
var pausespeed=(pauseit==0)? copyspeed: 0
5 P$ D& p6 x/ b: }: [6 Mvar iedom=document.all||document.getElementById
0 p% @: b1 W9 S: Bif (iedom)8 [& }3 f' ^/ ]. ~7 C1 P( d
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')6 V2 ]5 u) a# l) D7 @! q! Y
var actualwidth=''+ g0 E' @' X2 a9 j
var cross_marquee, ns_marquee
$ R% H/ k. ^- F: }6 i4 A4 C9 x! `/ i, D d
function populate(){
7 F9 P3 u, w( T9 i L! Rif (iedom){' ?# G; o. k% h9 v+ x6 I! d8 D
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
7 v+ b8 S4 D) x" Jcross_marquee.style.left=marqueewidth+8* e4 Y' Z x7 u( y/ S! {; E
cross_marquee.innerHTML=marqueecontent; w' D- j6 n$ a3 c
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth% Z3 H. V$ D, w/ O; a3 q% S. ]- ?
}% s1 B# h, p6 F& o' w" q
else if (document.layers){
! O- S6 B; U: q/ Z+ Uns_marquee=document.ns_marquee.document.ns_marquee2
, g" q6 b) b- ~" nns_marquee.left=marqueewidth+8
, w% g2 F, m) [: W! C7 {& B, fns_marquee.document.write(marqueecontent)
- d4 K4 Z5 _! g2 _% sns_marquee.document.close()0 E* c" f: F# C0 c& b$ K) a( I8 `9 y
actualwidth=ns_marquee.document.width
_% p6 b- C8 Q% }( ^}
3 O- S- r O9 ?. _/ V# ~5 c0 mlefttime=setInterval("scrollmarquee()",20)
" I% r3 X8 S2 q7 @4 V+ s+ _}, \5 l- F* ^4 l; `( L/ T
window.onload=populate; z1 v0 d7 [( @) X: T; [
7 B, i) j3 h8 M
function scrollmarquee(){) O, S8 K5 j9 e
if (iedom){
: }5 ]- u2 K' J! M& ]8 z, g' mif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))' z2 `; s# X( [& |: `5 F
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
$ P; u" u- L2 v1 I6 J2 k7 Nelse$ ~) L" u5 _8 ^+ P8 L7 [
cross_marquee.style.left=marqueewidth+8+ a$ M E. R8 j! R E6 o8 o
% [* i: q4 b2 k- k" h- A}
; v7 \, l- r9 C* Y( d! Velse if (document.layers){
& U3 x% L4 T$ T2 j) D( bif (ns_marquee.left>(actualwidth*(-1)+8))
4 B) F5 T. V3 \) f( x# |ns_marquee.left-=copyspeed9 Z( {# L2 p& [9 O
else `! ~! L) C7 g; c( c$ h& P1 v5 G
ns_marquee.left=marqueewidth+8
8 q' ]& N/ V: m" k& H" Y/ [}
t/ D {; }& W# G}$ y/ t) |" ?- G' g0 B; a
! h, L6 h- g( A* G1 m# n% P
if (iedom||document.layers){7 C- d* F7 |+ Z! M0 a
with (document){
& O3 i8 e7 m3 {( Z' Idocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
. X! Z7 p$ l4 A/ D; Wif (iedom){2 G' e2 n- @) q% ^- ~
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')! A, W3 q: m7 @6 Y4 P, o8 E
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
( B6 D, U, ` }& a+ F( q' K& B( jwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')( o: }3 R6 a# M
write('</div>')
% J8 ]- h: m; B& v4 @7 e}/ Y; {" i7 a0 r" ?5 C) ^' y3 t6 X' p
else if (document.layers){
6 X' s3 o/ ?2 j: D cwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')& w( j1 W0 G% G, R+ Y) e
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
- j& u/ k5 L% \- Y+ O2 B' ]write('</ilayer>')
. L) d- m: W) a. y}
( S; p4 U, Q$ F# Ldocument.write('</td></table>')& X2 G- m' g4 K6 i
}
1 I) |+ H1 A4 H}- }$ U9 u2 X4 p8 t
</script> |
|