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

|
网页之跑马灯文字特效
//修改宽度
$ ?2 [2 t6 q$ o" U$ c: a1 t5 y* g7 Vvar marqueewidth=3007 D( u# p& }) \4 Y/ j Y: s" ~
//高度
1 x: y/ f$ x- R) I5 j4 ~( ^+ \var marqueeheight=25
/ M( {9 [& u: e$ Z5 D, k//速度(1-10)
# c1 E4 U P$ C" w0 ]2 U+ `0 ovar marqueespeed=31 B/ O0 X8 f' o2 Y& {% T
//背景颜色. @* q# u r+ R5 ]# h
var marqueebgcolor="#FFFFFF"4 d; N1 D3 I9 P6 Z" V
//是否能暂停 (0=no. 1=yes)?0 R# c2 k8 }3 B; B9 l" p
var pauseit=1
( o( u$ {- W N# W2 R7 L! X% m! }- B b
//修改显示内容
9 i( l O6 R% ?) Vvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'7 X/ i4 T/ R$ Y& D( g
, @& I* s* t _6 m$ B8 m$ c
) u( X1 N2 S( r2 y4 q, J////下面不需改变////////////
( _- d4 I* n- z, w- f& n; z/ ?" @$ R, [. R
var copyspeed=marqueespeed8 r) F8 [* T( |
var pausespeed=(pauseit==0)? copyspeed: 0' ^$ r3 C6 m" T2 Y7 L2 K2 k3 r
var iedom=document.all||document.getElementById% V- a ^* G7 o) i7 t% o5 Y, U! M
if (iedom)8 c1 C% [- N/ W7 B1 f+ ^& N
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
+ a S7 u3 S0 Vvar actualwidth=''
( `$ H$ I7 l# f7 C% Lvar cross_marquee, ns_marquee* L! Q4 P2 z3 }# v. P
5 n3 P: ?; M/ }; O' }% q6 _6 a
function populate(){ R2 c2 `9 B* b7 q
if (iedom){4 L0 G/ ]2 `% F7 G1 Q
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
) f. X- F N( S5 kcross_marquee.style.left=marqueewidth+8/ J% O* o2 C* p% ]& u7 [7 D' ~: R
cross_marquee.innerHTML=marqueecontent: f$ P( [+ z/ D3 x
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth; k& u, [( p3 ~1 l" F* z
}
9 I9 {, L* X0 }9 d$ {: @- T# ^3 j: lelse if (document.layers){
2 t H3 J% y7 T$ f7 Yns_marquee=document.ns_marquee.document.ns_marquee21 ~* h% r A9 {3 Z, g
ns_marquee.left=marqueewidth+8' r1 {8 E% [& L" r3 {
ns_marquee.document.write(marqueecontent)
1 X2 \' |* N5 t" J) u8 ans_marquee.document.close()
6 W. g$ B. O& m9 \actualwidth=ns_marquee.document.width
3 \" y8 D1 B" V7 X! [}+ e3 K/ a8 W5 c! u
lefttime=setInterval("scrollmarquee()",20)
! w0 g. u# q R, @ W5 ~}9 m0 h0 C9 M1 [' x# ?" o
window.onload=populate
m. l4 ~. {0 s9 e/ e
1 q/ v$ u9 r; s* L/ G/ P ^$ }function scrollmarquee(){
( I& B; G! o2 ]* h1 |+ nif (iedom){- U3 O; L3 S4 Z8 X
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
6 V8 q L% y5 q/ K- x2 W* Vcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed- X' q: D' d( `0 Q4 P/ M5 R
else
+ R2 p+ p% E& R: ?7 ] vcross_marquee.style.left=marqueewidth+8
0 e$ y. m+ B( Z" M2 @5 ^8 I# |" g+ q9 R, ^5 B2 h1 i
}
0 g) o5 w2 c0 d8 G Telse if (document.layers){% u" N. Z$ T8 y5 a) V7 g5 N n
if (ns_marquee.left>(actualwidth*(-1)+8))+ e, W7 H" N# @, I% @
ns_marquee.left-=copyspeed
1 z8 b8 }) c( P+ P1 [else' u+ @% t8 D: V: T" T- M
ns_marquee.left=marqueewidth+8
! o6 Q3 N" }8 I6 g- R, g}& G$ A' P9 |* X, a |. k( i* b$ i
}
s/ ~) Q1 x$ s6 T4 u0 W" h% o; M+ v, [
if (iedom||document.layers){
% F* E; R6 b% n2 Zwith (document){: E9 ]' n% |, I/ v- O; F, D
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
- z# A- W* k! s& N* h7 yif (iedom){
7 B2 }0 |4 V e k9 H zwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')- f0 S! r9 o$ G
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')( A/ @( G" ^* J
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'). A- a G( F1 p4 ?0 c8 j% c
write('</div>')3 ]+ R. z1 x- i8 t- [
}; K: j! h1 x, Y2 d' P& t
else if (document.layers){5 h# x% R+ P' g( M& h
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>') s9 f. e' z6 ~3 t+ {
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')7 {6 V5 e9 K$ {; ~, S$ s
write('</ilayer>')
! R ?: Q. B! }' ~. \- u) M}1 J& m1 O' k6 T8 G+ Q
document.write('</td></table>')/ {% p4 \, _/ `; c; t9 j9 E9 i- L
}5 _7 H8 b8 Z* q! d6 m5 M: J; @- C' [
}
0 |5 K$ Q7 G7 k9 M9 c/ }4 ?</script> |
|