WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Javascript Background Scroller
Categories : Java Script, CSS, HTML Click here to Update Your Picture
Joshy Jacob
Date : Aug 31st 2006
Grade : 3 of 5 (graded 12 times)
Viewed : 16271
File : 4492.zip
Images : No Images for this code example.
Search : More code by Joshy Jacob
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
Like this code?
Show the author your appreciation.
 

A background image scroller in Javascript. The background of the image scrolls like a marquee. The direction of scrolling and the speed of scrolling can be set. More than one scrollers are prossible with different direction of scrolling and speed.

Examples are provided in the HTML file.

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> Scrolling Background </title>
<script>
<!--
var DefScrollSpeed = 10;
var DefScrollDirection = 'horizontal'; // (horizontal, vertical)


function BGScroller(ID, SD, SS, BG)
{
    Elem = GetElem(ID);
    if(!Elem)
    {
        return false;
    }
    else
    {
        if(BG)
        {
            Elem.style.backgroundImage = 'url("' + BG + '")';
        }
        SS =  SS ? SS : DefScrollSpeed;
        SD =  SD ? SD : DefScrollDirection;
        BGScroll(ID, SD, SS, 0);
    }
}
function BGScroll(ID, SD, SS, Pos)
{
    Elem = GetElem(ID);
    Elem.style.backgroundPosition = (SD == 'horizontal') ? Pos++ : '0 ' + Pos++;
    window.setTimeout('BGScroll("' + ID + '", "' + SD + '", ' + SS + ', ' + Pos + ' )', SS);
}
function BGScrollerInit()
{
    // Creating background scroller
    // Parameters are
    // 1. Element Id
    // 2. Scrolling Direction (horizontal, vertical)
    // 3. Scrolling Delay (Smaller means faster)
    // 4. Background Image
    // Except (1) all other parameters are optional
    BGScroller("Elem1", "vertical");
    BGScroller("Elem2");
    BGScroller("Elem3", "vertical");
    BGScroller("Elem4", 'horizontal', 30, 'scrolling_horizontal.gif');
}
function GetElem(ID)
{
    return document.all ? document.all[ID] : (document.getElementById(ID) ? document.getElementById(ID) : false);
}
//-->
</script>
<style type="text/css">
<!--
body{background:#F2F2F2;}
.tblScrolling{width:500px;height:500px;border:1px #C0C0C0 solid;font:bold 12px Arial;color:#333333;}
.tblScrolling td{vertical-align:middle;text-align:center;width:50%;height:50%;}
//-->
</style>
</head>

<body onLoad="BGScrollerInit()">
<table style="width:100%;height:100%;">
<tr><td>

<center><table cellspacing="0" class="tblScrolling">
<tr>
    <td id="Elem1" style="background-image:url('scrolling_vertical.gif');">First Cell</td>
    <td id="Elem2" style="background-image:url('scrolling_horizontal.gif');">Second Cell</td>
</tr>
<tr>
    <td id="Elem3" style="background-image:url('scrolling_vertical.gif');">Third Cell</td>
    <td id="Elem4" style="background-image:url('scrolling_horizontal.gif');">Fourth Cell</td>
</tr>
</table></center>

</td>
</tr>
</table>
</body>
</html>



Javascript animated menu items
Categories : DHTML, CSS, Java Script, HTML
Page Loading Message shown during the time your site's page is being loaded.
Categories : HTML, CSS, Java Script
Table editable dynamic form with edit + selection (select / option) + checkbox.
Categories : Java Script, DHTML, User Interface, CSS, HTML
Higly Customizable Javascript Calendar Script
Categories : Java Script, Calendar, Date Time, HTML, CSS
Show or Hide your Content using Javascript
Categories : Java Script, HTML, CSS, Beginner Guides
showing Help (assistance) to the user while filling html forms.
Categories : HTML, Java Script, Form Processing
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides
Rollover Image link effect using only single image.
Categories : Web Design, HTML, CSS, Beginner Guides
Bookmarklets are simple tools that extend the surf and search capabilities of Netscape and Explorer web browsers.
Categories : Java Script, HTML, General
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
How to keep your tables width stable even if you have long strings inside.
Categories : CSS, Web Browsers, HTML, Beginner Guides
Changing the Style of form objects using the JavaScript OnClick method.
Categories : Java Script, Form Processing, Beginner Guides, CSS
How to get the Focus (Cursor) into a Form-Element.
Categories : HTML, Java Script
complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password. improved security using time functions to initialize random number generator.
Categories : Java Script, HTML, Security, Authentication, Strings
CSS Container BOX , with cool CSS Design
Categories : CSS, HTML, Web Design