Send this to a friend
http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
1 (function ($) {
2
3 $.fn.vAlign = function() {
4 return this.each(function(i){
5 var ah = $(this).height();
6 var ph = $(this).parent().height();
7 var mh = (ph - ah) / 2;
8 $(this).css('margin-top', mh);
9 });
10 };
11 })(jQuery);
12
13
(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);
Send this to a friend
from: http://www.position-absolute.com/articles/jquery-fade-and-slide-toggle-plugin/
1 jQuery.fn.fadeSliderToggle = function(settings) {
2 settings = jQuery.extend({
3 speed:500,
4 easing : "swing"
5 }, settings)
6
7 caller = this
8 if($(caller).css("display") == "none"){
9 $(caller).animate({
10 opacity: 1,
11 height: 'toggle'
12 }, settings.speed, settings.easing);
13 }else{
14 $(caller).animate({
15 opacity: 0,
16 height: 'toggle'
17 }, settings.speed, settings.easing);
18 }
19 };
20
21
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);
}
};