Skip to content

A simple jQuery plugin to absolutely horizontally and vertically center an element within its parent.

License

Notifications You must be signed in to change notification settings

StephenWidom/centerr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

CENTERR

A simple jQuery plugin to absolutely horizontally and vertically center an element within its parent

USE:

$(window).on("load resize",function(){
	$('#targetElement').centerr();
});

OPTIONS:

mobile: 767

The browser width below which centerr won't adjust the target element

fullWidth: false

If true, don't set a value for left or margin-left

NOTES:

  • You should add "display:none;" to the target element to avoid having it render before properly positioned.
  • Make sure your target element's parent is relatively positioned.

See it in action

Developed by Stephen Widom - http://stephenwidom.com

About

A simple jQuery plugin to absolutely horizontally and vertically center an element within its parent.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published