|
||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
Web-
. Web-,
- , ,
-. , . <.html> <HEAD> <IL></IL> <STYLE> DIV { font-size: 72; font-weight: bold } </STYLE> <SCRIPT> var
dx, timer; dx = 2; function
movelmage ( ) { livediv.
style. pixelLeft += dx; if
(livediv. style. pixelLeft + livediv. style. pixelWidth ) document.body.clientWidth) dx = -dx; if
(livediv. style. pixelLeft <= 0) dx = -dx; } function
setupAnimation() ( timer
= window. setlnterval ("movelmage ()", 100) } </SCRIPT>
</HEAD> <BODY onLoad="setupAnimation() ; "> <DIV
lD="div1" STYLE="top: 50; left: 50; position: absolute; z-index:
1">J</DIV> <DIV ID="div2" STYLE="top: 50; left:
100; position: absolute; z-index:
-1">a</DIV> <DIV ID="div3" STYLE="top: 50; left:
150; position: absolute; z-index:
1">v</DIV> <DIV ID="div4" STYLE="top: 50; left:
200; position: absolute; z-index:
-1">a</DIV> <DIV ID="livediv" STYLE="top: 80;
left: 0; width: 30; position:
absolute"><IMG SRC="tips.gif "></DIV> </BODY>
<.html>
13.2.htm. tips.gif,
, Web, Windows WinNT.
tips.gif , 13.2.htm,
Web-. , . 13.2
.
cod .html- ( <HEAD>).
,
<DIV>. , , . -
.
: setupAnimation movelmage.
, ,
- . (
"" .) ,
, , : var
dx, timer; dx = 2;
: dx timer.
, "" , .
2; ,
. .
.
13.2.
, .
"" ,
. ,
: - ""
, .
- "" ,
setintervai window.
- ""
, , .
, ,
ciearinterval window, . , . .
, ciearinterval ,
, timer, . -
"" setupAnimation.
. function
setupAnimation() { timer
= window.setlnterval("movelmage()", 100) }
, , onLoad,
Web-. setlnterval
movelmage 100 -
"" .
: <BODY
onLoad="setupAnimation();">
onLoad -.
, , movelmage.
: function
movelmage() { livediv.style.pixelLeft
+= dx; if
(livediv.style.pixelLeft + livediv.style.pixelWidth >= document.body.clientwidth)
dx = -dx; if
(livediv.style.pixelLeft <= 0) dx = -dx; }
. : livediv.style.pixelLeft
+= dx; ,
, livediv.style.pixelLeft
= livediv.style.pixelLeft + dx;
pixelLeft style dx.
pixelLeft
.
: if
(livediv.style.pixelLeft + livediv.style.pixelWidth >= document.body.clientwidth)
dx = -dx;
, .
pixelLeft
pixeiwidth, .
ciientwidth body
, , dx.
ciientwidth , body
Web-, , body.clientwidth
.
, , : if
(livediv. style. pixelLeft <= 0) dx = -dx;
, .
pixelLeft ,
, dx.
dx, ""
. , . ,
Web- Navigator 4.x.
, .
13.2.htm 13.3.htm .
, . if
(livediv. style. pixelLeft <= 0) dx = -dx; <.html>
<HEAD> <TITLE></TITLE>
<SCRIPT> var
dx, timer; dx = 2; function
move Image ( ) { document.
livediv. left += dx; if
(document. livediv. left >= document .width) dx = -dx; if
(document. livediv. left <= 0) dx = -dx; } function
setupAnimation ( ) { timer
= window. setlnterval ("movelmage () ", 100) } </SCRIPT>
</HEAD> <BODY onLoad="setupAnimation() ; " STYLE="font-size: 72; font-weight: bold"> <DIV
ID="div1" STYLE="top: 50; left: 50; position: absolute; z-index:
1">J</DIV> <DIV ID="div2" STYLE="top: 50; left:
100; position: absolute; <DIV
ID="div3" STYLE="top: 50; left: 150; position: absolute; z-index:
l">v</DIV> <DIV ID="div4" STYLE="top: 50; left:
200; position: absolute; z-index:
-l">a</DIV> <DIV ID="livediv" STYLE="top: 80;
left: 0; width: 30; position:
absolute">'<IMG SRC="tips.gif"></DIV> </BODY>
<.html> ,
Web-... ...
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
|