you are here: codestackercodes [RSS] → tag plugin [RSS]

vertical align plugin for jquery

http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/

(function ($) {
// VERTICALLY ALIGN FUNCTION

$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	var mh = (ph - ah) / 2;
	$(this).css('margin-top', mh);
	});
};
})(jQuery);

// $('#mydiv').vAlign();

jquery fade and slide toggle plugin

from: http://www.position-absolute.com/articles/jquery-fade-and-slide-toggle-plugin/

jQuery.fn.fadeSliderToggle = function(settings) {
 	 settings = jQuery.extend({
		speed:500,
		easing : "swing"
	}, settings)
	
	caller = this
 	if($(caller).css("display") == "none"){
 		$(caller).animate({
 			opacity: 1,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}else{
		$(caller).animate({
 			opacity: 0,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}
};

// use: $('#my_div').fadeSliderToggle();
Displaying all 2 Code