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

|
网页之跑马灯文字特效
//修改宽度% H* F' U, @0 V1 K& z- M! T$ I
var marqueewidth=300
4 N" D; O" L8 ^. C//高度
( S* q" k- x7 y$ Q1 }" V- ovar marqueeheight=25
# D- ^2 G5 r: B% _$ ~6 [/ l//速度(1-10)
3 s- v( z# S! y+ L! b1 T% xvar marqueespeed=3
4 O. l# |& j: r7 ?. `5 P7 J//背景颜色! J, R5 p7 {# [3 m
var marqueebgcolor="#FFFFFF"
6 T- S* M9 j H. G) N//是否能暂停 (0=no. 1=yes)?
* T$ C( F) q* ]2 [var pauseit=11 ~( r D5 @4 f L# F) D. A- g
4 |, S" [, k4 L/ u- i# W4 P
//修改显示内容
+ ^) m4 ~6 Q* F w! T/ A; Cvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
& X' q* B0 i, a( {, k9 x9 Q) [
1 e) U6 w* I# s; v/ |: R
3 i( C+ @+ n2 U! w1 H3 x////下面不需改变////////////* ]% s8 ?; }; V8 f+ f
& p# J2 S" P& @
var copyspeed=marqueespeed
, l3 C, a3 ~3 y" H4 H: }6 ?, Lvar pausespeed=(pauseit==0)? copyspeed: 0
/ T. D, q% k& m& x( \6 z3 Q; F& Jvar iedom=document.all||document.getElementById; Y: J$ A* d! C8 z0 s
if (iedom)( U$ H8 q: {# _. ^& R; V3 Y2 I
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
+ C% _7 U: P1 j Wvar actualwidth=''
' v, U( I! S' i7 y) }var cross_marquee, ns_marquee1 [- }$ Z2 R% @
n$ R: e, g1 ~# @6 {+ O
function populate(){
& { H* y+ i4 C, X$ p0 Nif (iedom){
7 c- H: v0 f( p# _0 x' bcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
( u4 C4 g% x) H: y# f _% V1 qcross_marquee.style.left=marqueewidth+87 u2 e0 z# B! B' @7 }9 A
cross_marquee.innerHTML=marqueecontent" O# r9 [9 z& m& n
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth8 g, N U* I8 S7 C: p; P
}
, S, _6 J- j: r( [. a0 ^else if (document.layers){
( W, z/ C. _, h Q! gns_marquee=document.ns_marquee.document.ns_marquee2
: v! W' W: p/ F2 R J* u$ Yns_marquee.left=marqueewidth+8
: K) H6 l" s% H: Q( S6 `( Vns_marquee.document.write(marqueecontent)
& z [% s- J* S) j; |$ K6 Ins_marquee.document.close()
" Z2 f9 p' O$ H+ ~actualwidth=ns_marquee.document.width7 w# z" s) @. L7 A
}2 _; }8 K/ F; T1 t1 |. ~0 S
lefttime=setInterval("scrollmarquee()",20)
! T. _: O( |) k @- O5 l1 V: ]}
! x& _5 y* R( f* D3 r. o* iwindow.onload=populate; s7 F& h4 X# l) C4 C1 X
+ `$ x* u. s! [$ l# B5 x0 gfunction scrollmarquee(){4 ^, }$ @3 B/ o G1 p
if (iedom){ g. ]# w" u. T5 ^( t9 T
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)) f8 r! F% `2 `- J
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed# Y1 P& n9 N( V3 a
else$ r2 n# F0 ~ R7 `: B; F+ B0 s
cross_marquee.style.left=marqueewidth+8
1 {: f" G4 v2 f D0 D' ^0 j/ p1 m" B* l5 n7 _% K* V c
}
: m4 {+ O7 g2 r+ _. s5 j* yelse if (document.layers){
' y: m( @) d9 Y+ iif (ns_marquee.left>(actualwidth*(-1)+8))
7 b- Q; n( \: lns_marquee.left-=copyspeed
* F R( q" l8 n9 \5 K" |else `: h' u. f) X8 i, E( I6 R# L" |$ @( G
ns_marquee.left=marqueewidth+8& x& u j: P* r; U
}
% z7 R9 J( F! T5 b}
7 L' ?# |4 F3 L$ y) {6 h: S$ b- v* |6 P( ~9 P. E+ @$ T; K/ x
if (iedom||document.layers){* @8 C. D) _- b# P% @& K
with (document){! m) {! Z4 E o
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
: i5 ?2 Z @# C8 wif (iedom){! F7 r C% W, t8 } c) S
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
0 s0 J+ x( j- j) k$ V# P% lwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'): ?3 q/ D8 x5 J" A s
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
+ Q6 Q! f5 R8 O# f! _, jwrite('</div>')
. a8 D% z8 b z& G3 @; g}
; a2 ~7 m* v. ^else if (document.layers){
5 o+ l0 M: B) g4 H0 Awrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')- a9 {+ z0 e- a% P9 i* T. I" l
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
- J- Z7 h) Y( U( y* P1 Pwrite('</ilayer>')9 O" A, d& [$ N+ q) n
}
; e* O3 Q7 i1 S0 `* C% hdocument.write('</td></table>')( F) t% y: ?. u: ^( O
}8 a* A% Z5 O2 H! s
}
8 x0 o2 h" a+ i {7 u u</script> |
|