PHP Classes

File: javascript.php

Recommend this page to a friend!
  Classes of Er. Rochak Chauhan   PHP Scroller   javascript.php   Download  
File: javascript.php
Role: Auxiliary script
Content type: text/plain
Description: JavaScript File
Class: PHP Scroller
Display text messages scrolling vertically
Author: By
Last change:
Date: 15 years ago
Size: 770 bytes
 

Contents

Class file image Download
<?php header("Content-Type: text/javascript"); ?>
window.onload=init;
var flag=0;
function $$(o){ return document.getElementById(o);}
function init(){
    var w=screen.width;
    $$('bannerbody').style.left=((w-600)/2)+"px";
    $$('bannerbody').style.visibility="visible";
    setInterval("scroll()",1);
}
function scroll(){
    if($$('sdiv')){
        var top=parseInt($$('sdiv').offsetTop);
        var h=parseInt($$('id1').offsetTop);
        t=top*(-1);
        var chk=(h*len);
        if(t>chk){
            $$('sdiv').style.position="relative";
            $$('sdiv').style.top=h+"px";
            top=parseInt($$('sdiv').offsetTop);
        }
        if(flag==0){
            $$('sdiv').style.position="relative";
            $$('sdiv').style.top=(top-1)+"px";
        }
    }
}
function onOver(){
    flag=1;
}
function onOut(){
    flag=0;
}