Posted By

talbs on 04/27/09


Tagged

toggle jquery fade animation useful learningjquerycom blindfadetoggle


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

benrudolph
talbs
strangesthings
keith


[JQuery] blindFadeToggle


 / Published in: jQuery
 

URL: http://www.learningjquery.com/2008/02/simple-effects-plugins

Mad props to Karl S - http://www.learningjquery.com/2008/02/simple-effects-plugins

  1. jQuery.fn.blindToggle = function(speed, easing, callback) {
  2. var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
  3. return this.animate({marginTop: parseInt(this.css('marginTop')) <0 ? 0 : -h}, speed, easing, callback);
  4. };

Report this snippet  

You need to login to post a comment.