Skip to content

DoomHamster/Align-jQuery-Plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Align jQuery Plugin

The Align plugin builds off of the jQuery animate function to align one or more elements on their offset parent.

Usage

.align( options )

options: A map of additional options to pass to the method. Supported keys:

  • container: The DOM object with which to be aligned. default = parent element.
  • offsetTop: an int setting an additional offset in pixels along the Y axis. default = 0;
  • offsetLeft: an int setting an additional offset in pixels along the X axis. default = 0;
  • alignY: A bool indicating whether or not to align the Y axis. default = true
  • alignX: A bool indicating whether or not to align the X axis. default = true
  • duration: See jQuery animate.
  • easing: See jQuery animate.
  • step: See jQuery animate.
  • queue: See jQuery animate.
  • specialEasing: See jQuery animate.

Examples

Default Settings:

$('#MyElement').align();

Horizontal align using the built in jQuery animate 'fast' speed:

$('#MyElement').align({
	alignY: false,
	duration:'fast'
});

Align duration 2000ms:

$('#MyElement').align({duration:2000});

About

jQuery plugin to align an element relative to another.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published