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

|
网页之跑马灯文字特效
//修改宽度7 }6 B* w4 ]: k3 [6 w
var marqueewidth=300( d$ v! m( ~1 r: ~# @& e) }! |" F
//高度
* M8 F6 N% j; l) c& f3 Mvar marqueeheight=258 M4 I! @9 J% W0 w4 d- L" ?( G2 O; C7 a
//速度(1-10)
6 F8 o! @. |6 Q+ N, _# |# Z0 Tvar marqueespeed=3 c2 i8 n' V9 h2 S( s% B
//背景颜色/ } W8 p# y7 p" N/ w/ X U
var marqueebgcolor="#FFFFFF"
4 l$ e# Q' W# D5 V//是否能暂停 (0=no. 1=yes)?* J, g1 U3 A5 \: U+ `/ u% L8 L
var pauseit=1
# m$ l" J& F+ y& S
- q1 C/ Z- Z" Z( Y) ^$ r7 B//修改显示内容
7 y4 s' j1 x2 i& x1 S9 [var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'3 Q( F _1 G0 O: q' {! _' V! E7 @
- h2 g, V# l% p: D; L
+ S6 j: O1 ^8 f/ @9 j* d2 M0 y////下面不需改变////////////0 N3 Z. M+ l* n
/ `. {* j" ` b
var copyspeed=marqueespeed. d p' M* O o* ~4 Z8 F! P& Y
var pausespeed=(pauseit==0)? copyspeed: 0
V4 U4 g/ Q* ^var iedom=document.all||document.getElementById; n7 m& S2 l2 x5 ~5 ]/ }7 J& l9 A' C
if (iedom)5 Z3 ]* Z. r8 t8 ^' ]7 [3 W$ D
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
2 |: v0 R6 L ]% }# _var actualwidth=''
$ s6 Z% [( I* @( E( G' ~var cross_marquee, ns_marquee
* |0 a) W+ G H9 v0 }
; T% g, _) p" h, z* X! P/ `function populate(){
9 P7 U+ @0 \4 R R- Oif (iedom){
" n1 |$ s Y1 m3 n0 M! ]1 zcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
) R$ ]- }8 F- B R; t/ ocross_marquee.style.left=marqueewidth+8
1 M! Z( t) k4 D6 p3 O: y6 y( {) X, o' Y8 rcross_marquee.innerHTML=marqueecontent# H7 n1 z, F2 T* m) m0 z* d
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth$ B7 n4 U7 n& N, ~: I" \$ W$ Z2 g- H
}% D; \; z& P6 z- J2 W [8 q" n, Z; ^
else if (document.layers){3 I0 O0 S# O' N }
ns_marquee=document.ns_marquee.document.ns_marquee2
2 T/ q4 |& P' i. D3 E- `ns_marquee.left=marqueewidth+8. {" v; T5 P: c, {. {
ns_marquee.document.write(marqueecontent)8 ^; B# F- Z3 W3 S
ns_marquee.document.close()7 w$ W# {- i+ b; H
actualwidth=ns_marquee.document.width
8 O7 j9 f+ ~" S2 N}. L3 w1 Q% t' t
lefttime=setInterval("scrollmarquee()",20)( D5 a( ~2 u1 S* A5 U O* m
}: h8 @. L3 N+ R( i* p
window.onload=populate
, Q7 l/ ?6 {0 [6 p& H" }
0 f/ I( x* r' s! z& I* ifunction scrollmarquee(){$ K2 \! t3 f8 t$ s
if (iedom){7 I( I) g, g, H8 R( C
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))! @- T* v2 r( m% r
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
4 e5 v) x1 q. p, celse3 j9 G M8 x; E) P; m1 W# D2 F# m; T; }
cross_marquee.style.left=marqueewidth+8+ k. M. C+ V' O; V( j" x3 k
8 `# z2 O7 |/ p5 A/ o7 h}
* l1 O1 Y. q% Q6 d$ ielse if (document.layers){
, ^6 |6 @. F8 i3 {if (ns_marquee.left>(actualwidth*(-1)+8))
5 @- a( Q l# H0 T& Fns_marquee.left-=copyspeed8 J; u& `/ ]0 ~ b) g% {
else
' N3 F' ?1 K' Q8 mns_marquee.left=marqueewidth+8* A0 @( i. V! R) H2 @. o
}) e0 V8 U6 p" N' E5 n
}* `1 B1 a/ \4 Q4 k0 [- x
7 ]9 I# \6 B$ x }7 \$ Y Q1 p( Bif (iedom||document.layers){
! S8 }# T, l( t+ Q z- ]( c; m1 Bwith (document){5 |6 B& d) b: P3 Q3 u
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')+ u, H+ |! _3 L* w' K Z7 p2 X7 O
if (iedom){
' I% V! C* ~4 E, c; ]write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
( f C2 f9 W$ m- U7 H: `! _write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')5 t2 @( j+ r/ f3 \+ e9 @$ X" h$ O: P
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
& E+ y+ m" h; K; fwrite('</div>')8 v C& W7 Y8 V' x; u2 c5 S# {, A) I
}+ ?6 h! Y9 n* L1 r$ y
else if (document.layers){; }: d3 v, U. U" o9 r2 q( @
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')) ^: X$ `% s5 b5 f/ C
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')3 ?' p' y8 l: E" l+ `
write('</ilayer>')
& t" C+ N d" @% T9 f$ E8 c2 w}
2 K" e8 L, @! H9 j" R( tdocument.write('</td></table>')
! I) \4 p# U- t. x( j& D) w) N}
, {1 O# I+ B8 o% W}* i( T; c2 ?6 t. `
</script> |
|