🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

CenterIt is a lightweight yet fully configurable jQuery plugin that enables you to vertically (horizontally or both) centralize a DOM element within a given container.

centering

Documentation

CenterIt

A jQuery Plugin to center a container within another

How to use

$('#element_to_center').centerIt();

You have following options:

$('#element_to_center').centerIt({   parent: '#container' /* Parent container; default value: 'body'  */,   vertical: true, /* center vertical, default value: true */   horizontal: true, /* center horizontal, default value: true */   autoListener: true, /* Listener for auto centering on window resize; default: true */   position: 'fixed' /* which position you want to display the element; default: 'absolute' */ });

You May Also Like