返回列表 发帖

网页之跑马灯文字特效

//修改宽度+ A( F# r' ~# w# I" ]# P
var marqueewidth=3009 `6 g6 _2 v, a$ {  ~
//高度
% X7 S9 S" S4 u/ B4 S+ C7 j9 M' ^var marqueeheight=25
0 o) X5 k9 \. N- A$ Q$ k3 n//速度(1-10)
. N9 P6 V3 x( ovar marqueespeed=3# m1 v) j# B% \$ D+ v7 c; [8 q
//背景颜色2 g2 U0 O( t) y  X# X( B
var marqueebgcolor="#FFFFFF"
3 a' D( e/ B* ^: V; ~6 F6 ]//是否能暂停 (0=no. 1=yes)?
. p! h0 ]! u! ]6 T0 Z( Rvar pauseit=1
3 _% G8 s# [2 d+ {3 Y" f4 D! Q' _' {7 x) p3 Q
//修改显示内容5 c: O; ^$ Z% H9 s. i" N! L$ f/ A
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
, T) S' |' Q' Z
. Q! q; y  t. s2 W9 k- I9 Y# e, j5 r. z5 V2 g% }1 `# ?2 K( D/ i
////下面不需改变////////////
9 B( @6 Q+ b' D" e) [
, `7 ^& |1 L! W0 Q1 bvar copyspeed=marqueespeed" f( J* u0 z* J# U& `* A
var pausespeed=(pauseit==0)? copyspeed: 0
% m6 L1 Q& S( ~" z- U6 y' \( qvar iedom=document.all||document.getElementById
7 Z3 R2 d; J+ @1 B- |5 j# eif (iedom)# s" I3 b$ q. e; x# {* X- ^
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
3 J: d! ~3 n* ?9 Z: S% @) ^var actualwidth=''
' D& Z! v; r. o, F; kvar cross_marquee, ns_marquee) v( H; q: B1 r# x* r) D8 h
7 V  p+ ]) N/ h3 ?# x
function populate(){9 }- w) v( T4 s& X
if (iedom){
9 o  k4 h" \" U' Xcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee6 |0 V& w9 I: Z- k- Z& b
cross_marquee.style.left=marqueewidth+8
# s" q$ ~+ t  mcross_marquee.innerHTML=marqueecontent1 E0 H( H0 A; }
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth5 ]: j. Z  V! Z& L) |  J7 s4 V
}
( E5 H& M' I" celse if (document.layers){+ a- n. J  X# s  L2 g( g" X  O
ns_marquee=document.ns_marquee.document.ns_marquee2/ z! t$ V* l$ S* F  y
ns_marquee.left=marqueewidth+8
9 K5 i* ?% J" x5 B( F; yns_marquee.document.write(marqueecontent)
' c5 E, {- a$ M3 n1 Rns_marquee.document.close()* h, L: E/ x- Z: v( y  \, Q: ?1 P* H
actualwidth=ns_marquee.document.width
' L. q& M4 Y6 j/ r+ a, M4 K}
! s2 A& p# l- h( @& D8 Dlefttime=setInterval("scrollmarquee()",20)- V: ~, R) \" K% W* _9 k2 L/ S
}
0 D/ O; t6 h$ x5 C( ]$ W4 ?3 Rwindow.onload=populate
9 e5 g' u/ e5 t$ P% n0 ?
( a! s3 {" n1 [; V: z# wfunction scrollmarquee(){  ?5 F! T4 j1 G
if (iedom){
# P9 `3 H% J' \( v. {if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
+ u* o9 A- j2 h9 c/ ?/ ^/ Wcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
# F, d" {& V! N2 Y  {else+ I" K' U1 Y! ]
cross_marquee.style.left=marqueewidth+8+ X( ?' `% O+ I- X2 C4 ]& U
7 W: H( I) U+ [0 K# K' v3 M% z5 J8 m
}
' [- ?# p0 y$ t4 ?else if (document.layers){
! M% O& a( m7 x; @0 mif (ns_marquee.left>(actualwidth*(-1)+8))" _; ~$ A4 e4 X: h
ns_marquee.left-=copyspeed
- P+ S/ F7 I. R- C# k5 ?+ |else
- o' h, e* t- |$ I% Z( R' lns_marquee.left=marqueewidth+8, z! R+ v9 ~! k; _
}8 R( e- F  R6 r- w
}
9 g9 w( A; I* [8 T6 q4 o/ N  A) [1 t1 T* T
if (iedom||document.layers){
1 W% S, B% h) xwith (document){
" _0 |; R' r& `. H7 sdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
4 ]4 G; N1 X" [: H( a( A( ~# tif (iedom){
3 V' t: H+ d/ Kwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
/ f4 |" ~( D, G5 R+ E1 p8 Nwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
* G  O8 @. S+ J2 A' _2 Xwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')  J7 [) V" z0 f' y% u
write('</div>')
7 F3 D' K  k5 C% j}; }% t$ \, `: \; h4 C' G
else if (document.layers){5 Q# u  W, j9 H( k
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
4 c; F2 x: G; s4 b0 I0 H9 c1 c4 Dwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')( S$ S0 Z, o' R* |) S  w
write('</ilayer>')
' u. t. _/ @# t* v7 v* ~' C}4 Y8 l. ?3 Z' M# q/ D) R0 ]1 @% `
document.write('</td></table>')( P* }0 Z  g/ r* P. t
}
. ~1 K2 }) y1 K1 D% }3 A( [& \# a}; c1 s& |% X2 m7 j: [/ S
</script>

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