jQuery background color animation

 

 

jQuery | | 18-09-2011 - 08:49 PM

 

Was het je al opgevallen dat de achtergrond van de site de hele tijd van kleur veranderd? Hierbij een jQuery script die dit mogelijk maakt. De runAgain zorgt ervoor dat de animatie zie herhaald.

 

 

 

$(document).ready(function(){ function runAgain() { $('body').show() .animate({"backgroundColor":"#ffffff"},2000) .animate({"backgroundColor":"#fff4f4"},5000) .animate({"backgroundColor":"#fff9f4"},5000) .animate({"backgroundColor":"#fffff4"},5000) .animate({"backgroundColor":"#f7fff4"},5000) .animate({"backgroundColor":"#f4fffa"},5000) .animate({"backgroundColor":"#f4fffe"},5000) .animate({"backgroundColor":"#f4f8ff"},5000) .animate({"backgroundColor":"#f6f4ff"},5000) .animate({"backgroundColor":"#fcf4ff"},5000) .animate({"backgroundColor":"#fff4fa"},5000) .animate({"backgroundColor":"#fff4f5"},5000) .animate({"backgroundColor":"#ffffff"},5000, runAgain) ; } runAgain(); });

 

lines

 

Reageer via Facebook