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

|
网页之跑马灯文字特效
//修改宽度1 G& r* x; K+ z. v& x
var marqueewidth=300
( h2 f( \. g4 @1 H- S# I//高度
/ q5 s% w2 G7 q5 Nvar marqueeheight=25
7 ~" p8 A) V. q0 u3 q//速度(1-10)
/ l/ ]0 c; w- n+ K0 A7 Z; {& Yvar marqueespeed=3/ k' A1 y) ^) n. W9 p
//背景颜色3 _# O3 t5 D$ X. a
var marqueebgcolor="#FFFFFF"" W) p0 y& M$ T* q+ {
//是否能暂停 (0=no. 1=yes)?, }6 i/ \: g9 [1 J' n; o
var pauseit=1* V0 y3 j! [% f2 T# G/ ~; n
; `* i' s' U) y7 I8 t( q
//修改显示内容# b0 {3 z) i6 A
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
! a0 T/ C! d, S: Y4 i
0 S7 x! r) M$ G9 F* d
2 c# W5 K7 f I, P- K9 G////下面不需改变////////////
- b' ~8 r! Q5 G/ z) J% A
x6 G3 W+ A* J. a8 ^+ N/ d4 Xvar copyspeed=marqueespeed
6 A# Z2 D* d8 P/ K' Ivar pausespeed=(pauseit==0)? copyspeed: 0
# }9 T% Y' A5 q( w1 [var iedom=document.all||document.getElementById& L* n4 g) z: x( m
if (iedom)
! A, D" d" o4 e8 T( g; G; |/ [document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
) z' h) d; B, p Yvar actualwidth=''1 p4 [) K; H' U4 [, |( [
var cross_marquee, ns_marquee
, Y- {3 v* Y8 |! }6 n. ` u: r6 n; j! H# [8 W
function populate(){
g! \% _) _8 |2 K2 @if (iedom){
( E. v/ P5 Q: }; p8 vcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
. N% |- z! P' f* Q) fcross_marquee.style.left=marqueewidth+8
5 x$ Q9 d* G* q* b' _' fcross_marquee.innerHTML=marqueecontent$ S# N0 f Z4 I; u
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
9 w5 [8 k: B# s; L/ q- I}( q: R' j" K, Q! R3 w; T
else if (document.layers){
; j) R2 L. @2 e9 Ins_marquee=document.ns_marquee.document.ns_marquee29 q; Y, M7 ^' R4 a5 A0 ?
ns_marquee.left=marqueewidth+8
$ {5 y; N( u2 x* P& t Fns_marquee.document.write(marqueecontent)
2 K5 g3 }- t/ b# w; I. T2 ]7 Zns_marquee.document.close()0 p& `" ` g$ Y5 e
actualwidth=ns_marquee.document.width9 c5 E1 r, m" J8 ~" w
}
3 t3 [4 ]5 Z0 f0 V: z& vlefttime=setInterval("scrollmarquee()",20); C$ u8 ]0 b5 L% L
}4 i1 z( F7 x" N k# G+ P) d0 f
window.onload=populate2 e. i& H3 S- \
/ y& I8 ]- H; ~function scrollmarquee(){; [; p* Y6 T9 B4 B5 `) N( N4 X3 ^
if (iedom){
+ y8 y. f: V% K3 Eif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))' E9 `. ]9 `, x/ t. u
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed3 f, e( f( o5 Q( z& Y
else
1 X6 [5 u8 M5 u2 Rcross_marquee.style.left=marqueewidth+85 ^* q- l2 [* R, g. J
$ k4 [9 d$ H0 @# ^# _: R; M}, K1 f3 z' ? I8 C
else if (document.layers){& y9 I# L0 J: F% D/ W
if (ns_marquee.left>(actualwidth*(-1)+8))
% J; h1 d$ z" j' F8 h* h8 Ans_marquee.left-=copyspeed7 B% u- R, [7 m; _/ v; m/ q9 U
else
) `3 F, w4 I ?+ y8 k2 f* c/ w. C$ ans_marquee.left=marqueewidth+8
5 Z5 |6 D, G6 s# H$ C. V! [}: |7 z1 Y, ?! L- V
}
) S" f$ C3 G; D5 s: V, `( O
" X- F0 @+ Z+ d! ~! u" @if (iedom||document.layers){
- q0 s1 g5 }' u0 A. o) ?with (document){
2 l8 \) O- f5 _ c$ c# G% G4 Mdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')7 i- g( v4 k& \) E0 j5 l
if (iedom){
4 U, I% r3 f( p8 q+ O) r/ [write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')" g2 h: N: ]7 F
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'), K6 I( v; N( ?6 f$ f* u2 I# [
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')- M- @% E/ V" T1 k9 I1 d3 R" M" G
write('</div>')
9 K& {6 o/ I( s" R}
' N. e/ K9 U5 @8 f4 @- kelse if (document.layers){
4 Z+ Y; c! W" P0 |, pwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')9 D j ?: b+ j
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
5 r8 M* f2 \$ J( \( ~: L- ~write('</ilayer>'): \: t. E. a# \$ p+ a" a
}
9 A. z4 ]9 G" J) _! P# {7 ddocument.write('</td></table>')
( h. e: }9 Z7 m N}
- L" G/ n' ?( P; H+ `1 y}
9 D+ c' m* H3 h0 F" e( W3 v2 D</script> |
|