获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度$ U: U, l, {; l5 r; N/ t
var marqueewidth=300
- |2 t/ j) |+ L% P//高度
% y! z( }* F) |7 Dvar marqueeheight=25
9 Z; D# L. W  B. P//速度(1-10)
, M* v7 b; C9 L' {$ v0 ]9 |" Cvar marqueespeed=33 @* o) S  k% o4 B) W/ h/ T
//背景颜色7 S4 }- }: O( [( b
var marqueebgcolor="#FFFFFF"
& {% i; ^$ ]3 a. r7 s) v2 @7 I//是否能暂停 (0=no. 1=yes)?% y! o/ [" m/ I% d
var pauseit=1
0 D2 [  Q  e5 h, c  d* W) \# V/ j0 c( e( [) T' t
//修改显示内容9 d. b0 F) L8 G" l
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
+ Z: P3 i+ `* X1 `2 `8 n1 E+ K0 w+ l  d9 x# Z
! S/ S0 N. r: o# o+ r/ E
////下面不需改变////////////9 S5 h2 x. M2 O6 U8 D! j+ a4 O
7 W  o0 F+ _$ J- B: o1 N5 I
var copyspeed=marqueespeed
+ q' O6 i7 D6 A/ f5 G. `- ^var pausespeed=(pauseit==0)? copyspeed: 01 W( l7 \+ d$ e
var iedom=document.all||document.getElementById
9 t) v. g) J- |6 Gif (iedom)
1 _( w/ t4 i; [; f' n2 g! Ydocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')4 D  m- Q( f( B# p- o- ]8 O& s
var actualwidth=''
8 l, H, T, V0 [5 }7 Ivar cross_marquee, ns_marquee6 z9 L2 v$ ?+ N4 }
1 Z8 S/ j4 ~. S' _
function populate(){! `, S" X. O' h; t) f' F
if (iedom){+ [" r# p( n: O7 Y* t4 F9 [) Q
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
. [3 B( U$ z3 x# R% T7 H/ d& q# Ycross_marquee.style.left=marqueewidth+8
& q% E2 H( {3 ccross_marquee.innerHTML=marqueecontent8 v9 N+ [, S* K, d5 r* @
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth: B. x; {5 w, U6 h4 X* f6 ]
}, |$ V3 Q% x% H* \
else if (document.layers){
% v3 @5 c* E# a8 G2 s8 e4 gns_marquee=document.ns_marquee.document.ns_marquee2
2 f. q* ^4 v9 Y0 ?8 ~' p+ R7 @ns_marquee.left=marqueewidth+8
. t: L1 L) P8 j6 e$ q  zns_marquee.document.write(marqueecontent), w3 K: K5 \* l9 y* P7 l4 {; z* n
ns_marquee.document.close()5 W/ V' A2 ]. L2 f6 @: b: s
actualwidth=ns_marquee.document.width
7 o5 B/ g! e# b* j}( `. D% S! p' j$ b3 c
lefttime=setInterval("scrollmarquee()",20)
! ~  j4 N/ _; n3 Y& A' @& v2 U}" H3 C  f4 M4 d3 L$ D
window.onload=populate0 \( x# {- f2 u; j3 I
3 F- F7 u9 P3 w! |# x/ }" `
function scrollmarquee(){
* o5 G7 {# {( N! d; T! C4 {if (iedom){4 z! a% ?5 L) [5 f" I$ P
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
9 [6 u( ?3 N) s# `, R0 ^9 S( jcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed0 A$ |: w! U. ]- Q
else6 w7 e  s" k( r9 K7 y
cross_marquee.style.left=marqueewidth+87 u- m9 {8 D+ ~& B+ }0 ]4 {

) B  y( E0 Q- ]7 I}; x  o: \% h2 }
else if (document.layers){$ X5 y7 r$ R& Y$ Z! f5 Q4 F
if (ns_marquee.left>(actualwidth*(-1)+8))
2 w' k5 ~" n5 X1 e) R0 Nns_marquee.left-=copyspeed0 H7 a/ h6 z. m% Z9 _
else3 n- A4 q: \" [8 C/ [
ns_marquee.left=marqueewidth+8
5 }* ^# M1 w) F( r}
6 v* z* `2 p) w% c}
$ C: d7 v, P0 z; r  Z% Z. t6 T1 a( l2 c* R# k4 E1 O( ^- t5 }
if (iedom||document.layers){) F9 R9 n, r% }+ W- U% L/ ~# s# T, r
with (document){& T& c+ u1 @) i# |# v
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')5 j1 O( w  f$ e) |  G
if (iedom){- b, R) N! q1 u6 X+ I
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
) G4 G1 z% S& _/ _2 j6 f! e: Ywrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')5 o* W( Q( e) J- E" A2 s6 e
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
4 K& @0 w3 E1 r! t9 }write('</div>')
  L1 e4 t' V! w$ S- R3 @}
/ }7 A0 Z2 N9 l) zelse if (document.layers){) o6 r# N" a. f' o6 ]& M+ q- z
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
' a7 z( {% K$ cwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
# i, y: w! H! X7 k" H3 `0 \( t/ c+ L; ~write('</ilayer>')" H- e, i, ?) J+ A( r, l6 ?, {
}' ?( I% c* h0 |% ]! ~
document.write('</td></table>')
9 k- _% O- ]& b* L9 R}7 P9 \7 Q  H! {& H
}
! i5 l8 y: B! c8 F</script>

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