Animation (Basic)top #
function change() {
Jelo.Anim.ate({
me: $('#_loop'),
css: 'background-color: ' + Jelo.CSS.randomColor(),
duration: 1.5, // duration is in seconds
easing: 'linear', // see Jelo.Anim.Easing for other options
after: change // any function reference or closure works here
});
}
change(); // change will call itself after each animation
I will keep changing my background color... Forever!
Animate on Button Click
<style type="text/css">
#target {
background-color: #000000;
color: #ffffff;
}
</style>
<div id="target">change my colors!</div>
<button type="button" id="go">Go!</button>
<button type="button" id="reset">Reset</button>
<script type="text/javascript">
Jelo.load('all', function() {
// this animation fires when the Go button is clicked
Jelo.on($('#go'), 'click', function() {
Jelo.Anim.ate({
me: $('#target'),
css: 'background-color: #99ccff; color: #000;'
});
});
// use any valid CSS, including shorthand properties or colors
Jelo.on($('#reset'), 'click', function() {
Jelo.Anim.ate({
me: $('#target'),
css: 'background: #000; color: #fff;'
});
});
});
</script>
change my colors!
- recent changes — (see all)
-
- Sep 14, 2010 — Simplified DragDrop.
- Jul 19, 2010 — Fixed typo preventing reliably aborting pending Ajax requests.
- Jun 17, 2010 — Fixed a conflict preventing Easing.SWINGOUT and Easing.SWINGBOTH from running simultaneously.
- Apr 22, 2010 — Added Array support to CSS.toggleClass.
- random jelo shots — (see all)
