skip to main | skip to sidebar

Beardy Box

Monday, 5 October 2009

jQuery code to cycle background colors


<script type="text/javascript">
//<![CDATA[
$(function() {
$body = $(document.body);
var colours = ["#007777", "#777700", "#777777", "#770077"];
var currentColour = 0;
var fade = function() {
$body.animate({ backgroundColor: colours[currentColour % colours.length]}, 127000, fade);
currentColour++;
};
fade();
});
//]]>
<script>
Posted by David Kemp at 10:04

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Morning Brew Link

The Morning Brew - Daily .NET News and Views

Blog Archive

  • ►  2011 (1)
    • ►  October (1)
      • Functional Fun with Python
  • ►  2010 (2)
    • ►  June (1)
      • The state information is invalid for this page and...
    • ►  January (1)
      • Another reason to use log4net rather than rolling ...
  • ▼  2009 (3)
    • ►  December (1)
      • Google Visualisations API
    • ▼  October (1)
      • jQuery code to cycle background colors
    • ►  January (1)
      • ViewModel - the missing link?
  • ►  2008 (3)
    • ►  December (1)
      • Branches and Tags and All That
    • ►  September (1)
      • It was worth writing those unit tests...
    • ►  June (1)
      • SyntaxHighlighter
  • ►  2007 (9)
    • ►  November (1)
      • 1 UI Control, 73 Unit Tests
    • ►  October (2)
      • Shuffling a List in C#
      • Generics Array Helper
    • ►  September (4)
      • Installing Infragistics NetAdvantage on Vista
      • Take a bath...
      • Enum
      • Tools
    • ►  July (1)
      • .Net Testing And Assemblies Signed with Strong Nam...
    • ►  June (1)
      • Welcome To Beardy Box
Addicted toThe Most Intelligent Add-In To Visual Studio

About Me

David Kemp
View my complete profile