Center Elements Horizontally and Vertically with Prototype
Center Elements Horizontally and Vertically with Prototype
Ben Kittrell
-
10/17/2010 00:27:00
Comments: 3
Wanted to share this little snippet that lets you easily center Elements vertically and horizontally in the viewport.
Once you add the code you can call it like so...
The code is paste below and also on Gist.
Once you add the code you can call it like so...
$('my_div').centerVertically();
$('my_div').centerHorizontally();The code is paste below and also on Gist.
Comments: 3
Comments
| 3. | auto scanner | my website | 04/07/2011 09:31:56 |
this utility could also capture elements passing through and add them to an interval that provides dynamic resizing when the dom mutates... allot easier than stubbing in a buch or overly complex event functions everywhere.


Post a Comment