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

|
网页之跑马灯文字特效
//修改宽度6 z( P7 ?- f* o2 K! ^0 n- r0 @
var marqueewidth=3002 L: t! X- C# }2 E( i1 d! `9 Y
//高度
4 K8 F$ g6 W# e! I5 P7 ]var marqueeheight=25/ Z; ]/ [( R3 j" w7 q( F0 Z& X
//速度(1-10)
) x# E- } A( S5 Y* @4 \2 qvar marqueespeed=3# [7 S9 s' |4 l/ h, ?- F# r
//背景颜色8 x) X+ w3 r$ m4 |
var marqueebgcolor="#FFFFFF"
; C9 v1 ~7 B+ f//是否能暂停 (0=no. 1=yes)?+ ~4 ~9 g" [( T m' w
var pauseit=1
, k) d4 E) r5 u! O0 \2 h8 X8 u! U& k: T' t1 [" R' v) p
//修改显示内容
2 V0 M( F# F w G; Cvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'# U# p6 {0 [' i3 c
# b# s5 F+ p6 t. [/ q8 {
9 T/ V( u! T! D! |& n
////下面不需改变////////////
% g8 b* q7 N" `$ _1 N" |( \3 H- _# s! S: Q, N
var copyspeed=marqueespeed
9 l" [. u. k' D7 \# \5 ?var pausespeed=(pauseit==0)? copyspeed: 0
t' V$ v1 Q/ I6 \0 H6 k- ^1 qvar iedom=document.all||document.getElementById
+ V8 w0 j; T5 W$ H1 k, Wif (iedom)
( X9 T. I7 V2 m/ a3 k! j7 a: |document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')# t& b$ J! c4 `% V0 ?
var actualwidth=''& N5 W3 S( _7 s; W3 H
var cross_marquee, ns_marquee* d% B# b' N, k6 m# R# \- o6 e
+ Z, _0 j7 r4 U4 R3 k# V% Vfunction populate(){& Z0 d+ c6 [0 P7 [3 Q% {: Y
if (iedom){
: t, [& z* H9 O1 P* tcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee }5 w# b2 S! n) }6 g2 T
cross_marquee.style.left=marqueewidth+8
7 b4 v) t7 x" A7 L8 across_marquee.innerHTML=marqueecontent
* J" j" `! ?# k( u/ C6 }% |/ W3 cactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
; R* w' b4 A7 W5 Q3 Z! l}+ q! \. U- d& K; z0 J$ h" G+ B) i
else if (document.layers){; H4 [8 k7 A' X3 r( X q
ns_marquee=document.ns_marquee.document.ns_marquee24 y0 l8 u. H( `: \( ?$ W
ns_marquee.left=marqueewidth+8' y' W" ]) I2 M2 x5 S, B
ns_marquee.document.write(marqueecontent)
2 }- a7 H+ {& ~' nns_marquee.document.close()
! P7 M9 u' {/ Q- r M* Uactualwidth=ns_marquee.document.width
9 w* T; q0 y O$ [" ~0 c}/ ], w8 b+ o% j- }+ x
lefttime=setInterval("scrollmarquee()",20)
+ T: D+ t( X4 Z; }1 z' E* K}
' b9 ^$ u' {) _/ q/ Fwindow.onload=populate
2 y. u) @+ a, C6 @5 M
' N" M5 _, e( c/ H- f/ z) @' Bfunction scrollmarquee(){ y: k! ]2 L# N: W# [
if (iedom){7 ?& ?% Z" W) b3 ~ E+ P7 c
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
5 H# S7 \7 [! F$ j& Xcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
! r1 |9 B$ t4 g+ ^7 [else
* w; U% Q3 K, H& Z. G) p5 Bcross_marquee.style.left=marqueewidth+8
0 w! U9 p, d& X
/ _- L+ r2 S0 P9 I* d7 w}
: w R: z+ T( i" p0 t& i4 S, H: s* Gelse if (document.layers){
4 O0 Z: f3 O! f$ z* b/ zif (ns_marquee.left>(actualwidth*(-1)+8))% @, W' ~7 j4 l9 Q! Q# T. J4 ~; |3 p
ns_marquee.left-=copyspeed
; R+ v g- {/ A7 g3 C3 Oelse
8 n8 d1 ]4 C |+ W0 k8 F1 Uns_marquee.left=marqueewidth+8
2 Q7 w8 V3 C2 P/ Z' I}
3 E0 u# i; }, N x- b, n}# H( n% X9 g* [
$ l4 r( L: \( x3 Aif (iedom||document.layers){
* P% F# {! Z0 c, l! E4 k8 b1 bwith (document){
8 e7 ^; N& Y6 C) `1 edocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')0 c) P4 ~' e, \1 e! D6 S7 R: w& D
if (iedom){
% y5 m/ p7 y8 G3 Kwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')# U( M% U& H" s& P$ `0 P
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
+ Q4 Q7 P M: A* `write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')5 g: H: C' }) A6 _! e* v, I3 ~
write('</div>')! ~- Y' o- N- V
}+ R& _# l; I" \5 z8 n% q/ Z
else if (document.layers){7 Z* T, A* Q! D
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')3 m. F3 Z+ c: g
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')( w- v, y2 I! }' T; t, ?
write('</ilayer>')
- g& h9 K' d' b8 F8 W; b6 D}
7 P* Z. L2 i, [! \( cdocument.write('</td></table>')
; l& b& H9 k7 u3 |% Y; J}
7 H: y+ C; ` u3 u! d0 z5 p}
4 `8 d9 H1 X0 x" x: f; k</script> |
|