|
↑
Background Effects >>>
Scrolls HTML elements within a DIV. Can be modified to scroll vertically or horizontally.
Step 1: Add the below code to the <body> section of your page:
<SCRIPT
LANGUAGE="JavaScript">
document.write('<div
id="point1" STYLE="position:absolute;visibility:visible;"><img src="ball.gif"
width=30 height=29 border=0></div>');
var
xPos =
20;
var
step =
1;
var
delay =
3;
var
yPos =
0;
var
height
=
0;
var
offset
=
0;
var
yon =
0;
var
IE;
var
point=document.getElementById("point1");
var
name
=
navigator.appName;
if
(name
==
"Microsoft Internet Explorer")
{
IE=true;
yPos
=
document.body.clientHeight;
point.style.top
=
yPos;
}
else
{
IE=false;
yPos
=
window.innerHeight;
point.style.pageY
=
yPos;
}
function
changePos()
{
if
(yon
==
0)
{
yPos
=
yPos -
step;
}
else
{
yPos
=
yPos +
step;
}
if
(IE)
{
height
=
document.body.clientHeight;
offset
=
point.style.offsetHeight;
}
else
{
height
=
window.innerHeight;
offset
=
point.style.height;
}
if
(yPos
<
0)
{
yon
=
1;
yPos
=
0;
}
if
(yPos
>=
(height
-
offset))
{
yon
=
0;
yPos
=
(height
-
offset);
}
if
(IE)
{
point.style.left
=
xPos;
point.style.top
=
yPos +
document.body.scrollTop;
}
else
{
point.style.left
=
xPos;
point.style.top
=
yPos +
window.pageYOffset;
}
}
function
start()
{
if
(IE)
{
point.visibility
=
"visible";
}
loopfunc();
}
function
loopfunc()
{
changePos();
setTimeout('loopfunc()',delay);
}
window.onload=start;
</script>
|
Step 2: The script uses an image as part of its interface. You can create your own, or use the below :
(right click image, and select "Save Image As")
Upload it into the same directory as your webpage.
→ baca manga online: Komiku tv
|