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

|
网页之跑马灯文字特效
//修改宽度1 k9 D& D/ K4 Y. F" t
var marqueewidth=300
, G* A9 y6 r9 B# n//高度
% n7 n8 o, y( \6 b" R! B9 tvar marqueeheight=25) P& l; w8 k1 o" K) a" }, S3 ~
//速度(1-10)
# ^0 g, k6 R1 l8 M8 V, _3 Dvar marqueespeed=3( | A7 Y( ^6 [: Q1 b7 h
//背景颜色6 `! N& _& ?; h& d: B- P, {: N, x
var marqueebgcolor="#FFFFFF"! O1 Y5 N4 v, v8 `* v* J* q% j
//是否能暂停 (0=no. 1=yes)?/ b# G; I& y; Z# {, [, ]
var pauseit=1. H8 H+ B* Z; p, e: i
; i, a1 @ d4 I( K" ~
//修改显示内容6 h0 Q* D- Z) o/ v# W6 a( ~
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
2 S# y5 R v, O* d; u% V4 I
: o" s9 R! c# U7 b# j' W
" x q7 j$ x6 z! l f6 Z////下面不需改变////////////0 p2 R- Q0 s( w7 P; v
6 K: g. C8 \% w$ l7 ~3 \$ L
var copyspeed=marqueespeed# G, ]& ~: h$ q* o' ~ a4 ^& E; R+ ~
var pausespeed=(pauseit==0)? copyspeed: 0( L# s' @5 \) d4 A( E
var iedom=document.all||document.getElementById
; Y6 C. |1 z% L) m" K1 V/ B8 M- Gif (iedom)
: z6 s2 y2 {! N# N* A- udocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')6 Q- W( s8 @. O. T7 p5 D- Q* l9 B
var actualwidth='' Q/ u: U# C, L3 D% \
var cross_marquee, ns_marquee. b+ A; H. T/ W" ~6 n, n
1 `3 I* c. \; d5 ~8 s: ^" _1 R
function populate(){$ X, J' w( X; k
if (iedom){; b7 c7 q9 e1 ]& J# u0 Q
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
: q5 a: w, J1 i7 Mcross_marquee.style.left=marqueewidth+8$ t* }' V, V& A- b
cross_marquee.innerHTML=marqueecontent
3 s( f2 x7 Y3 ractualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth- p u9 V3 N8 c, ?7 L% v
}$ W* x6 E! |" T: P) V
else if (document.layers){
+ _1 U! J1 \8 x, Bns_marquee=document.ns_marquee.document.ns_marquee2
2 k" F! `- t7 `% A0 t$ U Kns_marquee.left=marqueewidth+8
$ N/ I+ h8 x% a4 g1 b! N3 cns_marquee.document.write(marqueecontent)- B$ s+ U9 ^# R7 k
ns_marquee.document.close()
$ A1 v8 T$ C+ n, B; H. f; uactualwidth=ns_marquee.document.width
1 T$ _( X6 t" Y; b$ t}
$ z4 ^+ j7 R7 Z* l3 d& Glefttime=setInterval("scrollmarquee()",20)
1 o7 y) H9 U- H" i}
k/ N2 C- q3 M) I/ lwindow.onload=populate' A* T, B8 V! L0 q- |
- }6 H3 ]2 n: a3 @function scrollmarquee(){$ r) V/ [' S/ y! W% H# }! f" b( }; s
if (iedom){
$ Q! L. e% i: {$ v Oif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))7 a5 D2 d- c' M1 K, }1 {. ~6 U
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed* I6 ]2 O/ W. `# O& G9 q
else: b m/ w5 a& u# v8 f" y3 H
cross_marquee.style.left=marqueewidth+8
$ ^& f- P+ g2 q, X+ V6 o- q8 U8 y3 k" y! Q
}9 r, F8 V9 |! Q- |
else if (document.layers){9 [2 b1 t! e- i
if (ns_marquee.left>(actualwidth*(-1)+8))% B5 u$ h& y; z! C. ]5 |
ns_marquee.left-=copyspeed! t9 L! j P/ h. u. j
else* } P F: @4 a
ns_marquee.left=marqueewidth+8
$ P) a9 h$ R8 C}
. v4 a, {; k) z) t$ n2 C}( l3 Z: P5 k+ D& A0 W
0 ~0 ^4 |7 w7 q( K
if (iedom||document.layers){
4 D; `8 _+ K ~1 @/ i% {4 ~3 `3 Twith (document){ _! P% U5 x, k' V# j4 p" N
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
; N! k8 P( p+ m( Z; }' q' V1 Mif (iedom){$ \1 j9 g, K g6 m8 e
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
0 t" R" r1 q" F% ywrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
5 I7 j" }; {* s3 T- B& Cwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')1 E. C/ ]* v, q4 B: W, _
write('</div>')
' [' Y: z! Q$ Z3 I" R}
, @0 D0 [( q9 K4 E$ zelse if (document.layers){
; B' k9 Y) r% o6 E2 pwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')) x _' q5 L" w
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
' @/ X9 U, h2 |write('</ilayer>')& Z; r0 ^8 V, b* a6 d! f8 ~
}
( r2 k. O7 Z5 O' {- d5 t3 Zdocument.write('</td></table>')
7 g) {9 I7 C( ]}5 {' ?+ v, n4 c( \! `
}
' n2 l' [/ }2 k4 `3 ^</script> |
|