Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language jQuery

(A lightweight JavaScript Framework)

Date:12/27/06
Author:Vincent Battaglia
URL:http://www.vinch.be
Comments:1
Info:http://jquery.com
Score: (2.84 in 19 votes)
function displayVerse(num) {
	switch(num) {
		case 0 : 	verse = "No more bottles of beer on the wall, ";
				verse += "no more bottles of beer.";
				verse += "<br />Go to the store and buy some more, "
				verse += "99 bottles of beer on the wall.";
				break;
		case 1 :	verse = num + " bottle of beer on the wall, ";
				verse += num + " bottle of beer.";
				verse += "<br />Take one down and pass it around, "
				verse += "no more bottles of beer on the wall.";
				break;
		case 2 :	verse = num + " bottles of beer on the wall, ";
				verse += num + " bottles of beer.";
				verse += "<br />Take one down and pass it around, ";
				verse += (num-1) + " bottle of beer on the wall.";
				break;
		default : 	verse = num + " bottles of beer on the wall, ";
				verse += num + " bottles of beer.";
				verse += "<br />Take one down and pass it around, ";
				verse += (num-1) + " bottles of beer on the wall.";
				break;
	}
	$("body").prepend("<p style=\"display:none;\">" + verse + "</p>");
	$("p").css("color","#CCC").css("font-family","Arial,sans-serif").css("font-weight","normal");
	$("p:nth-child(3)").css("color","#999");
	$("p:nth-child(2)").css("color","#666");
	$("p:nth-child(1)").css("color","#333");
	$("p:first-child").css("color","#000").css("font-weight","bold").show("slow");
}

$(document).ready(function() {
     	for(i=99;i>=0;i--)
     		setTimeout("displayVerse(" + i + ")",(99-i)*1000);
});

Download Source | Write Comment

Alternative Versions

Comments

>>  css örne&#287;i said on 06/27/08 15:42:11

css örne&#287;i css Font examples , Properties , Attribute - - //
http://www.css-lessons.ucoz.com/font-css-examples.htm

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: