Script Categories













Background Effects >>> Htm Scroller.

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">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */

<!-- Begin
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;
//point.style.visibility = "hidden";
}
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;
//  End -->
</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.

Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©