返回列表 发帖

网页之跑马灯文字特效

//修改宽度
' @7 J2 V7 y8 G  R8 `var marqueewidth=300
9 ?3 k! c0 G) w- Z* z) z5 k% C//高度) F+ u$ }/ Z- Z" g; D: o" _6 g
var marqueeheight=252 f9 b. F. A5 i0 y" R3 D: {
//速度(1-10)
' c1 W& S2 q) O8 u1 U+ X) |var marqueespeed=3
/ [' E# K6 ]" ^3 T( {/ ?  g//背景颜色
  r- R; b. T( D6 U( b8 r3 K% c& z5 uvar marqueebgcolor="#FFFFFF"
8 U" G) n7 @& s& f' T$ F//是否能暂停 (0=no. 1=yes)?, O7 c4 u* E$ Y7 W9 |" o
var pauseit=1
8 \" a$ I7 b. g
  ?  r% L, q$ W& M0 Z4 b//修改显示内容
( j( D; i0 E/ M! w7 Y- z, ovar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
7 [1 I8 f1 @* o, K/ g$ d; i2 ?) X9 H: y* c2 O8 }3 T

( K$ {% o$ K' u2 b////下面不需改变////////////
+ {1 g; r% b, Z
$ }5 Z( |$ Q$ C% ~: I6 ?- t" Zvar copyspeed=marqueespeed* X' ?0 ]( w7 B
var pausespeed=(pauseit==0)? copyspeed: 08 G7 L6 S: w: U
var iedom=document.all||document.getElementById" F3 j% l, x/ `, `' x7 |6 V9 ]
if (iedom)
- z0 X# J  l( X6 J7 b7 Xdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
, }5 {* j8 {4 n- k2 gvar actualwidth=''
' y( Q* A6 U. A2 `var cross_marquee, ns_marquee6 Q% F* s' V  `6 M0 n% l0 P0 r

6 v% h; o" x0 f# a8 D, V1 Y* ?function populate(){- O0 }, }. j8 ]+ k$ R! }
if (iedom){
* x5 q5 G. z6 O+ g0 Across_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
# w' y& z! X/ g' }# @( p: }  E6 c* h5 gcross_marquee.style.left=marqueewidth+8: d( G$ b7 s. Y2 T0 H
cross_marquee.innerHTML=marqueecontent( j+ H, v# j7 z% x: g! K
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth% j3 L0 y: u  _5 V# N: W' r
}
* D( L1 A" H! [" V  n( welse if (document.layers){
9 b3 e7 A4 f9 B' P5 s1 zns_marquee=document.ns_marquee.document.ns_marquee2
, z- @1 _  j' R- m/ I" N& xns_marquee.left=marqueewidth+8& Y5 E1 Z! o+ M+ P4 r4 F# o- t
ns_marquee.document.write(marqueecontent)
2 w. v% C. `# j+ a1 x% |ns_marquee.document.close()$ z% r  H" ]% v; ]: z# |: U
actualwidth=ns_marquee.document.width
  `$ K* |# J+ S: g" {4 _}2 H: V6 s' O& F; k  r* _/ I! D0 b
lefttime=setInterval("scrollmarquee()",20)
; q6 O. R6 _# y8 r3 O}2 v% y( ~' z) R  S" Q- i
window.onload=populate1 F. z% g# u; q
, L6 \, ~1 t$ O0 H( t) M; J
function scrollmarquee(){
% y3 y0 v) _, ^0 h6 _. |if (iedom){
& y0 S! p9 c  ?4 I' x- Sif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
' z; C' u$ g1 G; T! jcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
) a5 g6 I$ @5 b& O' w2 C) y  pelse, r% `. J. P8 Y
cross_marquee.style.left=marqueewidth+84 {' L+ |( _- u  D9 y

7 x: v* _- i* S( ]- c& Z- }}* ^2 R4 H3 o/ L! [. H5 R0 {
else if (document.layers){3 a1 |2 \8 r  Y3 @5 ?6 Z% F
if (ns_marquee.left>(actualwidth*(-1)+8))
, E- Z( Z) |, }) T) Z5 rns_marquee.left-=copyspeed7 W" }% l! `$ {% ^7 O% w
else
/ ~; ~; R: G6 m7 n" p0 vns_marquee.left=marqueewidth+8& P. e8 I: V. y7 g3 c. C. C
}
3 W  @$ {% q3 v- v}* H7 k6 Q" w$ G0 D( J. O
  G; |: Y" _# g6 k: w/ \5 t
if (iedom||document.layers){
. \5 s8 x( b, z" J: ?with (document){
+ h/ f- P5 h1 Z) X% P" S' H4 _document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
' G, S0 `% t/ L( n. v4 fif (iedom){  X% x" M8 Q! D* g, C4 ^* \
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'), ?* T0 b0 v, v
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')& R% i' }! ^/ \6 ~9 \( e
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
$ R% D% `, o$ D# [5 G  kwrite('</div>')
$ |8 r, y) ?9 I3 P& `}+ E  H, K1 ~7 Z9 k$ i! O- b% V
else if (document.layers){
9 t/ m; Q9 F, ~4 G5 h+ swrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')0 |, z1 [% y' m. M* P; Z* l4 p
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')% P* b. r  n3 K( Z' l
write('</ilayer>')" c4 H2 E7 w1 ?( _
}: ~# n& @. e8 H4 ?# H$ `' I
document.write('</td></table>')3 e3 P4 }- o. a2 x8 E
}
: H9 j, O+ W6 i* t) |}. l/ X7 f+ {1 W( @7 t6 O& T  t2 _
</script>

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