Core Docs | Additional Modules Docs

Element.prototype.fade


@Description: This effect is used to fade a dom element's opacity
@File: Element/prototype/fade.js
@Author: Paul Visco
@Version: 1.1
@Param: integer percent The opacity to end at between 0 and 100%
@Param: integer duration The time milliseconds to fade over
Example:
//fades to 20% with a duration of 24 milliseconds and alert 'done' when done
var fade = $('#myDiv').fade({percent : 20, duration : 24, onEnd : function(){
alert('done');
}});

//fades back to 80% after two seconds
window.setTimeout(function(){
fade({percent : 20, duration : 24});
}, 2000);