Minimal jQuery plugin to center objects.
Getting Started
Getting started is simple: include jQuery, include Centr, then:
$('#object').centr(); // it's that easy
Usage
Centr contains a few options. You can center horizontal
, center vertical
, add a class
& center the text
.
center horizontal
$('#object').centr();
$('#object').centr({ axisX: true });
center vertical
$('#object').centr({ axisX: false, axisY: true });
horizontal & vertical
$('#object').centr({ axisX: true, axisY: true });
add class
$('#object').centr({ addClass: true // add class "centered" });
center the text
$('#object').centr({ textCenter: true });
Examples
Check my website for examples and more information: http://boeddo.com/centr
Support
Centr support almost every browser. That's great, huh?
Author
Centr is made by Quincy Kools.
License
Centr is licensed under the MIT License