↑
Background Effects >>>
Scrolls HTML elements within a DIV. A version of the HTML Scroller modified to display a DIV on both the left and right side of the window for both IE and Netscape.
Step 1: Add the below code to the <BODY> section of your page:
< div id = "point1" STYLE = "position:absolute;visibility:visible;" >
<img src= "ball.gif" width= 30 height= 29 border= 0 >
< /div >
< div id = "point2" STYLE = "position:absolute;visibility:visible;" >
<img src= "ball.gif" width= 30 height= 29 border= 0 >
< /div >
<SCRIPT LANGUAGE= "JavaScript" >
var xPosLeft = 20 ;
var xPosRight = 300 ;
var step = 3 ;
var delay = 30 ;
var yPos = 0 ;
var height = 0 ;
var offset = 0 ;
var yon = 0 ;
var name = navigator . appName ;
if ( name == "Microsoft Internet Explorer" ) {
yPos = document . body . clientHeight ;
xPosRight = document . body . clientWidth - 150 ;
point1 . style . top = yPos ;
point2 . style . top = yPos ;
}
else {
yPos = window . innerHeight ;
document . getElementById ( 'point1' ). style . left = yPos ;
document . getElementById ( 'point1' ). style . visibility = "hidden" ;
document . getElementById ( 'point2' ). style . left = window . innerWidth - 155 ;
}
function changePos () {
if ( yon == 0 ) {
yPos = yPos - step ;
}
else {
yPos = yPos + step ;
}
if ( name == "Microsoft Internet Explorer" ) {
height = document . body . clientHeight ;
offset = point1 . offsetHeight ;
}
else {
height = window . innerHeight ;
offset = 33 ;
}
if ( yPos < 0 ) {
yon = 1 ;
yPos = 0 ;
}
if ( yPos >= ( height - offset )) {
yon = 0 ;
yPos = ( height - offset );
}
if ( name == "Microsoft Internet Explorer" ) {
point1 . style . left = xPosLeft ;
point1 . style . top = yPos + document . body . scrollTop ;
point2 . style . left = xPosRight ;
point2 . style . top = yPos + document . body . scrollTop ;
}
else {
document . getElementById ( 'point1' ). style . left = xPosLeft ;
document . getElementById ( 'point1' ). style . top = yPos + window . pageYOffset ;
document . getElementById ( 'point2' ). style . left = xPosRight ;
document . getElementById ( 'point2' ). style . top = yPos + window . pageYOffset ;
}
}
function Start ()
{
if ( name != "Microsoft Internet Explorer" ) {
document . getElementById ( 'point1' ). style . 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.
→ komiku baca komik online