Centering Elements Vertically with jQuery - centerEl

File Size: 10.3 KB
Views Total: 543
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Centering Elements Vertically with jQuery - centerEl

centerEl is a lightweight jQuery solution to center multiple block elements vertically inside their parent container. Check out this article If you're looking for a pure CSS solution to vertically align an block element.

See also:

How to use it:

1. Include the jQuery centerEl plugin after you have jQuery installed.

<script src="//"></script>
<script src="src/jquery.centerEl.js"></script>

2. Call the plugin on the block element and specify the parent element.


absolutePositioning: true,
parentEl: "#parent-element",


3. Default plugin settings.


additonalOffset: 0,
absolutePositioning: 0,
left : 0,
right :0,
bottom : 0,
parentEl: "",


4. Methods.

// Recalculate the element's height
// Useful for responsive layout

// Destroy the plugin

// Initialize the plugin

This awesome jQuery plugin is developed by mohandere. For more Advanced Usages, please check the demo page or visit the official website.