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

网页之跑马灯文字特效

//修改宽度- n% @5 x9 I5 R9 f+ N
var marqueewidth=300
) m2 j: ^7 g$ I0 C% i- B8 v) r7 o3 p//高度) i/ M0 w% B; @+ t  c
var marqueeheight=250 I7 u$ D# B2 a! O" s
//速度(1-10)
, |# k" W9 [0 D) Rvar marqueespeed=3$ v- p# K  E$ f/ Z7 m' E9 g$ p
//背景颜色: J; u  S9 j" ^7 @" z1 B' c: Z
var marqueebgcolor="#FFFFFF"
+ S% E* C. y; \8 N2 k0 j# v+ a- S. P//是否能暂停 (0=no. 1=yes)?
' f; A6 }' y1 u2 {6 ~var pauseit=1
( `* a3 s4 G! I. }6 a7 [( Q' y1 a4 w, v% H) Y; v! k/ Y& `/ a
//修改显示内容/ E0 {- z$ _, b* ]. A
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'6 z1 i/ `  B( ]
  ]" e8 ?" b. g/ i+ A

0 {& o1 m. c5 |6 w7 V////下面不需改变////////////
. I. P/ V; ?) d5 a
+ u: W" h/ g: p( Gvar copyspeed=marqueespeed
& Y, K& _4 S2 n  J& A0 ^var pausespeed=(pauseit==0)? copyspeed: 0( x3 O$ ]7 U3 A% d6 e' z1 A
var iedom=document.all||document.getElementById3 n3 z. X% T9 T, v4 l' n/ J3 b& r! l
if (iedom)
! x5 g1 Q# |6 [- Q8 idocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 H) Q9 Y$ ]% d3 }! F; E+ Q
var actualwidth=''& K) E( ^1 R# _9 Y  F, F- n6 n
var cross_marquee, ns_marquee8 n. e9 e; O4 z9 m& W+ R& j- u* B
0 z, B7 @- j2 V6 J5 @: S/ i3 `
function populate(){
& }8 l& G  R' [2 V3 C' m5 G8 ?if (iedom){
5 y( K- x" @( s: M' ?cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee' K& ?8 |: i: d+ g: J
cross_marquee.style.left=marqueewidth+8& m: C8 T2 W1 c! D6 H
cross_marquee.innerHTML=marqueecontent
+ V3 z* ^7 `; m9 O- [actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
. L6 `1 m! C) n+ o7 V1 N! p, G}
1 ]! F9 b  a- {' C  R! m" xelse if (document.layers){- n8 o3 e0 {9 b5 H  ^# G0 f
ns_marquee=document.ns_marquee.document.ns_marquee28 M$ R% Z3 ~% K3 u& x
ns_marquee.left=marqueewidth+86 P0 Z9 Z  u; t$ B# }( @( {
ns_marquee.document.write(marqueecontent)
* w7 Z# I: q, D7 \7 Tns_marquee.document.close(); q0 s. C6 E! N) j
actualwidth=ns_marquee.document.width6 ]: S+ A+ o( R
}# y# p' a+ q" K
lefttime=setInterval("scrollmarquee()",20)
% s  K/ i# P$ z( x+ W2 X0 c}% [: ]; k3 [+ f+ v8 w! Q1 A8 Q" r
window.onload=populate
- O9 B5 c7 G. |! r2 y, z# B5 p+ T" o' o) [6 A, N4 Z
function scrollmarquee(){( L' v, y) L( i, c+ V0 V1 r
if (iedom){
; I/ ^7 \4 R- m0 T+ I& pif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))" Q8 ?& z' |4 M8 e; E' N
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
: ]$ g+ ^3 G: I- Pelse; d0 z4 A0 ?( u7 m# w" I7 H5 I
cross_marquee.style.left=marqueewidth+8
7 Z5 w- j6 }; R
$ i6 U5 x& X; p3 ^' Y}2 M$ _0 M& Q. [% g; ]0 u0 l6 a& P
else if (document.layers){
4 `% f5 E4 n7 i% sif (ns_marquee.left>(actualwidth*(-1)+8))
# s+ B+ D4 ~( {  a7 h- w- ~" Rns_marquee.left-=copyspeed
% i1 Q1 P: v/ l' C6 c9 \- X& x5 ^else8 O% z9 J0 L# Z
ns_marquee.left=marqueewidth+8
( S% J4 O! N+ N0 [}8 e& ?5 L  l4 p) q  z
}, U5 r% l+ A% s

' f) k+ Y" S* u: R  l  a2 a7 {8 w7 ?if (iedom||document.layers){6 A. Y6 `% a0 s; c. E, I
with (document){
1 f/ w, ^' r! D# E6 P' U, Ndocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
3 |( i  R& p4 V' k3 n7 @; S; |7 U$ v+ Dif (iedom){
1 f# \4 F+ W9 k+ S, Gwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')! M9 H" G( v6 v1 e" @' l& k$ o! Q+ P
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
+ }( Q& C0 w' n! E& ^write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
& B9 W1 r& \: T, c3 Vwrite('</div>')+ X( L2 q0 _2 x7 }3 C" c# Z
}
$ d* \# u' K4 u+ Welse if (document.layers){' J5 Z" z* `' o% H3 D2 Z
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
6 R4 B' }( K9 u' _2 S% cwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
6 I9 ^6 r8 b! uwrite('</ilayer>')
* r! L( O. n7 q( k}
- n4 m. l# q: Gdocument.write('</td></table>')
" }, a3 n& f- \$ F/ n4 q3 j}4 d" P7 O' I8 o2 B2 j* U
}2 `% v. e# R5 n" n
</script>

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