WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
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 Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
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
Forex Trading Online forex trading platform

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 : Automatic zebra tables
Categories : Java Script, HTML Click here to Update Your Picture
Ioannis Cherouvim
Date : Sep 29th 2006
Grade : 3 of 5 (graded 2 times)
Viewed : 3762
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ioannis Cherouvim
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Script: Cascading Dropdowns
Author: Ioannis Cherouvim
Date : 2006-09-19
Demo : http://temp.cherouvim.com/forums/auto-zebra/

This script applies a class="zebrarow" on half of the rows of all tables which have a class "zebra". Then with css you can style all zebra rows.

function applyZebra() {
    var tables = document.getElementsByTagName("table");
    for(var i=0, length=tables.length; i<length; i++) {
        if (tables[i].className.indexOf("zebra")>=0) {
            var tbody = tables[i].getElementsByTagName("tbody");
            var table = (tbody[0]?tbody[0]:tables[i]);
            var trs = table.getElementsByTagName("tr");
            for(var j=0, lengthj=trs.length; j<lengthj; j++) {
                if (j%2==0)
                    trs[j].className='zebrarow';
            }
        }
    }
}


Usage Example
//run when page is ready
window.onload=applyZebra;



Builds JavaScript that updates the contents of one selector based on another.
Categories : HTML, Java Script, PHP, Complete Programs, General
Javascript Background Scroller
Categories : Java Script, CSS, HTML
How to create <SELECT> menues that change on the fly according to other <SELECT> menues on the page?
Categories : Java Script, HTML
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
Cool tool tip
Categories : Java Script, HTML, Web Design
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
Javascript linked dropdowns
Categories : Java Script, HTML, Classes and Objects
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
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
Bookmarklets are simple tools that extend the surf and search capabilities of Netscape and Explorer web browsers.
Categories : Java Script, HTML, General
How to get the Focus (Cursor) into a Form-Element.
Categories : HTML, Java Script
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
Bouncing Marquee at Status Bar
Categories : Java Script, HTML, Browsers