Minimal jQuery plugin to center objects.
Getting started is simple: include jQuery, include Centr, then:
$('#object').centr(); // it's that easy
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
});
Check my website for examples and more information: http://boeddo.com/centr
Centr support almost every browser. That's great, huh?
Centr is made by Quincy Kools.
Centr is licensed under the MIT License