返回列表 发帖

网页之跑马灯文字特效

//修改宽度
) h1 u9 H2 F+ c- d, gvar marqueewidth=3007 B5 }. i' ?0 J& e0 b* J5 }
//高度
% @+ }6 H# k" r$ Pvar marqueeheight=25
8 r: c! M. R: Y+ V) u# M: @: {//速度(1-10). G& ^2 U4 E- l3 r" R+ o/ O
var marqueespeed=31 U; h8 u( g# t% r! Q
//背景颜色3 f( F( ^  g- d/ _
var marqueebgcolor="#FFFFFF"
' j% g% T1 V" b//是否能暂停 (0=no. 1=yes)?
8 z0 U; c2 L" O. w+ F: }! vvar pauseit=1- @# z1 |" p) f0 j8 p; Q3 E, s

% q  y8 ?. S3 j  e; o' D//修改显示内容) T* R6 E( F  W- ^0 `& c1 ?
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
$ ]- P5 H, q+ H5 B' ]( g) q5 E, r1 y. ]

. L6 N. F% D3 Y4 W) B& }////下面不需改变////////////
! `6 k8 q2 v* G4 h% p! P$ e2 c
/ T6 \% v3 P2 q' _' o  ^var copyspeed=marqueespeed
% C. _: l  X9 ]6 V; g) s# j9 hvar pausespeed=(pauseit==0)? copyspeed: 0- ?( \9 g/ T( @! D& W% C- ~: @7 W
var iedom=document.all||document.getElementById
3 }4 O- M- N9 z* M, N; {if (iedom)% B, w6 W0 U! A; c! U0 f9 C/ J
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')0 Y# B8 C8 Q' a4 J2 B
var actualwidth=''
/ O, F3 S2 b/ o* H* J* Hvar cross_marquee, ns_marquee/ H. c; Z! c4 }/ H

  `" A, V6 c8 A# o' j9 Cfunction populate(){
0 H, Y1 q% v- N3 c- \  @* \) Pif (iedom){
# T1 c, h6 v" B& R$ scross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee5 h3 [) U" A0 ?+ R$ V
cross_marquee.style.left=marqueewidth+8
7 o6 i# v3 q8 p( Kcross_marquee.innerHTML=marqueecontent
" L" X9 ?! l1 [( H! R7 Y  {actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth5 G. r: _. ~8 k9 R9 p
}% l6 F6 t6 {$ H1 K: L
else if (document.layers){
7 r+ k' V, W8 m! \ns_marquee=document.ns_marquee.document.ns_marquee2
8 d; D4 N  u$ |' V+ Rns_marquee.left=marqueewidth+8
, [* R5 h9 w5 B( u3 hns_marquee.document.write(marqueecontent)
% N" R$ H) J8 h# V7 k* n" Jns_marquee.document.close(): x; w  k) I8 D9 e* g# x- ]' z; ]( s! z
actualwidth=ns_marquee.document.width
8 y1 }5 Z2 y) |' Q6 U}; g' O" O" J4 }+ `' |+ i
lefttime=setInterval("scrollmarquee()",20)/ J3 f$ f% \1 h0 K
}8 F! `" G5 S3 |, z  \% Q3 I
window.onload=populate+ u# V  |  O) D  G' n3 ^2 U2 ]

; h2 E! z8 U+ w9 |# k+ gfunction scrollmarquee(){( w) @1 m. i0 F( D9 C
if (iedom){& \  R3 p, o6 A
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))/ {: C8 [$ K! ~6 f$ b7 |
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed; f+ `5 g9 v8 n2 E
else
; }8 a5 w9 k0 O; r$ }) a% [9 ocross_marquee.style.left=marqueewidth+8; Q; p9 B- r$ n7 ]9 _

9 [& x/ j* `& n! d6 E0 F) a3 S}' ^, I- f' r& D# i+ F8 Z1 ~: w5 a$ q
else if (document.layers){% [' f1 F4 ~, G5 p
if (ns_marquee.left>(actualwidth*(-1)+8))3 t6 y" y- }. K! j5 u5 I2 R5 |
ns_marquee.left-=copyspeed( Y0 ~1 M2 C- I0 x9 ~/ C5 ]% o
else
# X9 O5 ^' [  j! o, N) V- lns_marquee.left=marqueewidth+8
- |! y' g' b' J' r2 W}( E: d( F9 {' g& d- x
}6 ~2 E; E) K; ~- L
5 b2 o8 l4 H$ e' r6 L) W& ~
if (iedom||document.layers){+ U5 L: z- r+ s3 d" J8 ^" e: n
with (document){
  w& z4 C. E6 U1 c( Pdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')0 i- N6 {/ h; P& T* b* q
if (iedom){
0 q* Q8 k1 A5 [9 W" Z* M, iwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')1 }3 H5 G" l' ]' X# g& r6 J
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
5 G7 M! R7 X6 c' X! M" i0 ]write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')7 N. z/ Q) S$ T! F3 m2 L
write('</div>')
& v3 Z( c4 J. n5 y# l7 [2 S}1 D0 {3 C- m" d% n- w; }
else if (document.layers){) a7 l$ K4 M3 j- z
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')( d% T9 z. }5 Z/ L3 {% x
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
/ v# Y* t5 g' b+ b. \$ H( Dwrite('</ilayer>')
: v2 [% T, S% ~; ~! K6 P+ L}
% X; V3 c; y' u6 t9 M+ X+ T8 @) wdocument.write('</td></table>')
, t! L% h$ r5 Z' I& [# |6 i# w}* s# M+ i0 ]) F1 ~  z1 g+ U
}
4 h! T& [4 Z3 E4 ?# R, {6 B</script>

返回列表
【捌玖网络】已经运行: