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

|
网页之跑马灯文字特效
//修改宽度7 w6 ?8 @$ x' N$ Z- `
var marqueewidth=300- S) L6 {! M9 R' R
//高度
( ~' Q+ `/ H; A/ t* w7 G/ Ovar marqueeheight=25
4 j; l+ T" B+ Z o. u//速度(1-10)
" ?3 h1 N% b( |6 R1 l# @9 j% _- ~- Ovar marqueespeed=3( z* m7 }/ l, B5 s# h3 u" B! h
//背景颜色7 y1 N. P+ V8 f
var marqueebgcolor="#FFFFFF"" R/ m8 K# T$ \2 C( |
//是否能暂停 (0=no. 1=yes)?, n. O2 u, i. F* B" N" R# y
var pauseit=1: A, Z0 I& o) n/ e0 ~# I2 R
, u8 }$ c& m: P1 q$ N: e//修改显示内容
: t! u1 H, d' g: J/ Q' Cvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
0 `/ K0 r0 ~+ X6 ~! E
+ P& ~6 ~% w. G7 P+ t9 d: b6 k% @1 ?
* L! t/ g, v* }( }////下面不需改变////////////
3 p5 W$ A: s u7 ~2 F2 S# D* V2 W. ` M
var copyspeed=marqueespeed: N5 r/ ?% ?% |8 H' `0 u9 Q
var pausespeed=(pauseit==0)? copyspeed: 07 r, j- P. Y5 M. h2 U
var iedom=document.all||document.getElementById
1 w$ \6 V% {9 f% _if (iedom)2 c/ Q: z* g+ [3 |2 y: H- ~
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')! |3 E' k; \/ A% S) l8 J
var actualwidth=''
& @4 v3 m1 S. o& b& ^3 ~var cross_marquee, ns_marquee7 S7 D5 @4 D) t6 y. H$ S% S4 ?
9 h A) A$ w+ i2 _9 |! t g5 ?function populate(){
, N$ _- n0 Z9 p. O* i' O) Xif (iedom){0 Q' P8 P' k0 i
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee' o. I/ t( v5 a
cross_marquee.style.left=marqueewidth+8
7 t. d8 c5 _$ I$ _8 |5 O- A a4 R9 hcross_marquee.innerHTML=marqueecontent
: [' J/ l( ]& t: V( W+ }actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth4 z5 h2 I) s8 ~+ P% \) R. u0 Z
}
" [9 q* k B/ t* f" D3 {: v" ]else if (document.layers){* g' x7 F2 v2 X" {' p h
ns_marquee=document.ns_marquee.document.ns_marquee2) u3 @# b8 q' p) z' N3 A. ?
ns_marquee.left=marqueewidth+8
, P* f$ {! G( D+ c4 Y1 Yns_marquee.document.write(marqueecontent)
1 s. S/ K B# q. R+ a4 Kns_marquee.document.close() `9 z9 N5 H2 }* n
actualwidth=ns_marquee.document.width
4 K4 C' {9 Y2 l- e}; E2 V5 m' ~ ?- G
lefttime=setInterval("scrollmarquee()",20)1 Q* x7 u- ~; e9 \ h& _
}. x+ ~$ a- p$ q# ?( I7 A: }* T0 j; `
window.onload=populate( Q8 I4 D7 c+ O8 V- h' w* ~8 O
+ \$ z/ b0 ?0 O' w$ h9 P: ^function scrollmarquee(){2 E! `9 G% t$ d" ]# i( W
if (iedom){, b( ~5 H* e3 ?8 t% @5 _$ J
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
+ R. F" f L, |% u" bcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
9 j2 m' F! w8 C7 z7 delse& {! w7 c/ f1 f3 u! w
cross_marquee.style.left=marqueewidth+8
' X3 Q: R' c: H" {
3 k( W$ z1 {/ H+ \3 h2 O( s# i$ p}
/ x" J0 P6 J5 P" o3 ^6 jelse if (document.layers){
+ O+ o1 j/ b! h+ Z" V+ {if (ns_marquee.left>(actualwidth*(-1)+8))
' g+ H2 w9 l J% P& ]' ~ns_marquee.left-=copyspeed3 D% f' x) x/ }$ n# ~
else; d8 B, Q# O7 ?( Z
ns_marquee.left=marqueewidth+8
: I8 ~# `: |( D}
2 P; H; |% O; }( Y+ p}
- p+ O4 {8 V" m' r5 J4 N8 R- u/ |# K. n# b4 |9 V
if (iedom||document.layers){$ p% ~" ]1 m4 v4 b# B
with (document){
/ T8 ~! t, v" [6 N; B# Cdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
8 H2 W7 J6 o% Nif (iedom){6 E3 Y& i( M7 Y) ~9 E4 O9 K. ^8 m
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
4 j8 ?( d7 y3 @9 c9 q4 Vwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
9 F' ^! x# a+ @( `write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')9 l# U/ l& m1 z2 D( [
write('</div>')
6 F! A# V6 S, x# W- O( D' L/ `}' v( i$ n# ?$ [5 X
else if (document.layers){. k( N* X) _7 [9 A$ Y/ Q2 A
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')/ r) F- F! P. `& U5 C1 i6 C0 {
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')! C7 g( w a$ `& M
write('</ilayer>')
% S1 ^. V- [- W: H& L5 H}- t' y; o$ J% B$ ?+ Q6 g' ^% \
document.write('</td></table>')
2 f) C4 P. w) z3 p2 h d. ]$ J! o5 ~}
4 u3 V" l/ w. ?- G' I3 ]}
v, ]1 `( o- x7 h! S' I3 m1 Z</script> |
|