Return to Snippet

Revision: 17600
at September 10, 2009 06:37 by joe-bbb


Initial Code
function centre_content(){
	var win_height = $(window).height();
	var content_height = $('#content').height();
	$('#content').css('margin','0 auto');

	if ( win_height > content_height ) {
		$('#content').css({
			top : win_height/2 - content_height/2
		});
	}
	else {
		$('#content').css({
			top : '10px',
		});
	}
}
}

Initial URL

                                

Initial Description

                                

Initial Title
centre element vertically

Initial Tags
javascript, jquery, center

Initial Language
jQuery