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

|
网页之跑马灯文字特效
//修改宽度7 @8 i: p/ b' N' [2 }8 g
var marqueewidth=300) ?% F6 b* e @9 u. K/ G
//高度
( h. m2 q: X9 H/ n. t; U9 h9 [, |var marqueeheight=25
- P8 r+ M6 A# x5 L# u e9 L& c! l//速度(1-10)+ h; }7 S9 H7 K) Z% j0 e) d
var marqueespeed=33 R3 b& a& Z+ ]$ Q) x1 v* |
//背景颜色. P1 ^/ X3 |1 p; F7 G8 N, A; ~6 N
var marqueebgcolor="#FFFFFF"
+ y! k, O2 U7 W: K//是否能暂停 (0=no. 1=yes)?5 P* I5 L; ~+ ], u
var pauseit=13 i, ?& p) g/ u
: I! Y% f+ b( E
//修改显示内容7 I. x0 C! N2 q) e* [! {) K8 E
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'8 b. Z0 M% b! }) @# L6 F( w+ F. ~# c
* |+ a. c; d, Y( R
8 O$ H( i& s2 g( c" h ?' _
////下面不需改变////////////: A" l4 r- |( |3 `9 G9 k9 j) A, ~
- O" L5 ~) T' H; w r
var copyspeed=marqueespeed
6 V9 a3 @- C3 \% F: T5 n& i6 `var pausespeed=(pauseit==0)? copyspeed: 0
/ t( s! a j; F6 O; Q4 Evar iedom=document.all||document.getElementById/ v& m. }. p2 V' L% R8 S- T4 ~
if (iedom)
# o* }# ]( B% P0 X$ C- L1 r/ Gdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')' t. P. Y' m# B. h' x: n
var actualwidth=''6 F2 U. w) D, {+ I
var cross_marquee, ns_marquee5 {: Z6 U! |! Y" n+ Y* V- n7 L# r8 v
9 l4 z3 `9 K+ `. g1 N8 U5 [
function populate(){
( B/ `4 b& Y2 c# N0 ?if (iedom){
j& V5 W- p+ F4 l: s* x' }& Mcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee$ w4 S- M/ q& K8 _; a* Q3 i
cross_marquee.style.left=marqueewidth+8
\/ g% H( f4 ]# O; r. f. R8 v$ pcross_marquee.innerHTML=marqueecontent
7 h( J' J% c( e( k9 y/ R! `actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth& x% _; G* r6 R f2 b
}
' r- U/ ^- _& X; {1 w$ J0 F" L% G0 ~else if (document.layers){* m% ~) c3 _2 q O9 I; q% I
ns_marquee=document.ns_marquee.document.ns_marquee21 R* V" ~; S% n* Y' [: S1 f
ns_marquee.left=marqueewidth+8
% B8 u m" {$ v9 H! \ns_marquee.document.write(marqueecontent)
" b: W+ y! @, s- cns_marquee.document.close()
: M. p. ?. R# Z; R* c. t; B8 [" r0 Dactualwidth=ns_marquee.document.width1 S3 {+ T# M! [8 U
}- P- m3 `0 a3 E7 j: Q
lefttime=setInterval("scrollmarquee()",20): ]7 H- S7 @- `+ z
}
+ ?1 A. G1 Z+ g& T) hwindow.onload=populate2 h, q& x+ ?/ U$ o
- n4 K/ J. A1 B: [. wfunction scrollmarquee(){, z: x. G: r2 n. z$ |+ Z9 S
if (iedom){$ H* \! u2 A$ h& f9 u! u2 m
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
$ i4 m- \2 o4 H2 v1 b, Z. `cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed- r# u/ o. V8 M# A9 }& n |
else* I4 I$ I' _7 [
cross_marquee.style.left=marqueewidth+8
# @' t$ L$ `/ L8 R$ |+ i
/ k; }) l* i% x}
0 O# i* y! I2 @% _! b' G" \# Oelse if (document.layers){
$ a5 V" [4 W% i# Aif (ns_marquee.left>(actualwidth*(-1)+8))
- H, L* ?) S: f* p8 mns_marquee.left-=copyspeed
+ m0 j' F& r# E+ H# K6 |+ q3 \7 @else
M) ]( F" u) }3 ^ns_marquee.left=marqueewidth+8
! u* B) G5 x. ^8 Q) h8 ~, y}
5 ~7 Q- d6 B& F. v" E) ~" {}
/ A$ [- H* X Z' N! m. z$ m% @$ k* n2 }/ H5 t3 k5 t" U. H( D, _
if (iedom||document.layers){
( k f+ ]! w8 H" m6 cwith (document){
; z1 p& R; h- ]# J6 cdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')) S+ A/ U/ i4 S9 |8 m/ E+ N
if (iedom){
- K- y; q( T9 Z$ l) ]( H& wwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
) C# k; v D5 e b) bwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
# U8 W4 [, o# U) dwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')& b1 T- Y, G$ H# D8 i- z f
write('</div>')* Q+ F# T V- N
}6 U% Q' O! O( N4 E+ z' v
else if (document.layers){
- m4 [' p) Q9 C* F& ?write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
. s4 H% w2 d- i, A) f7 Cwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
% F* \ e3 Y* J- Z+ {$ Uwrite('</ilayer>')# J$ ?, v7 ?' [
}# n) l. z7 B8 h# \1 A
document.write('</td></table>')
/ f! Z& `, e- Q4 L4 f6 P}% G' R# R9 C4 U& J! o
}
9 R5 `% c/ q' r. Q</script> |
|