1 /* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
4 * A 1/2 second fade out animation.
7 * @param el {HTMLElement} the element to animate
8 * @param callback {Function} function to invoke when the animation is finished
10 YAHOO.widget.TVFadeOut = function(el, callback) {
12 * The element to animate
18 * the callback to invoke when the animation is complete
22 this.callback = callback;
27 this.logger = new ygLogger("TVFadeOut");
31 * Performs the animation
33 YAHOO.widget.TVFadeOut.prototype = {
36 // var dur = ( navigator.userAgent.match(/msie/gi) ) ? 0.05 : 0.4;
38 // this.logger.debug("duration: " + dur);
39 // var a = new ygAnim_Fade(this.el, dur, 0.1);
40 // a.onComplete = function() { tvanim.onComplete(); };
42 // var a = new YAHOO.util.Anim(this.el, 'opacity', 1, 0.1);
43 var a = new YAHOO.util.Anim(this.el, {opacity: {from: 1, to: 0.1, unit:""}}, dur);
44 a.onComplete.subscribe( function() { tvanim.onComplete(); } );
49 * Clean up and invoke callback
51 onComplete: function() {
52 var s = this.el.style;
55 s.filter = "alpha(opacity=100)";