Skip to content

seung-lab/jquery.centerIn.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jquery.centerIn.js

jQuery plugin that allows you to center an element within an element.

e.g.:

$(element).centerIn(); // centers horizontally and vertically in parent
$(element).centerIn(window); // centers horizontally and vertically in window
$(element).centerIn(window, { direction: 'vertical' ); // centers vertically in window
$(element).centerIn(window, { top: "-20%" }); // centers vertically in window offset upwards by 20%
$(element).alwaysCenterIn(window); // deals with resize events

Author: William Silversmith
Affiliation: Seung Lab, Brain and Cognitive Sciences Dept., MIT
Date: August 2013 - February 2014

About

jQuery plugin that allows you to center an element within an element.

Resources

License

Stars

Watchers

Forks

Packages

No packages published