jquery - Animating the background color of a page automatically when a page loads -
jquery - Animating the background color of a page automatically when a page loads -
possible duplicate: jquery animate backgroundcolor
is possible animate/transition background-color of element automatically when page loads?
i have page info this:
<ul> <li> stuff</li> <li> other stuff</li> <li class="unread"> more stuff</li> </ul>
for elements .unread class want background image start off lite yellowish color , have fade regular page background-color (which white in case) think of new pm or notification on facebook, effect trying achieve.
you utilize css property transition
;
html
<div class="transition"></div>
css
div.transition { height: 100px; width: 100px; background-color: #ffffff; transition: background-color 1s linear; -moz-transition: background-color 1s linear; -o-transition: background-color 1s linear; -webkit-transition: background-color 1s linear; } div.animated { background-color: #ff0000; }
javascript
$(document).ready(function() { $('.transition').addclass('animated'); });
see demo.
reference: http://iamchenghan.wordpress.com/2010/05/30/css3-color-animation/
jquery css
Comments
Post a Comment