Skip to content
Alignment Plugin for jQuery
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.txt
README.md
align.jquery.json
jquery.align.js
jquery.align.min.js

README.md

#jQuery Alignment Plugin

Plugin to align an Element to another.

##Features

  • vertical align
  • horizontal align (works most like margin: 0 auto;
  • minimum Values for left an top position
  • each element can be aligned to evey other element

##How to use

###align to window

$("#some-element").align();

###align to another Element

$("#some-element").align({'parent':'#the-parent'});

##auto-update on window-resize

$(document).ready(function(){
    $(window).resize(function(){
        $("#some-element").align();        
    });
});

##Options

keytypedefaultdescription
parentjQuery Selectorwindowthe Element where 'this' is aligned to
verticalbooleantrueenable/disable vertical alignment
horizontalbooleantrueenable/disable horizontal alignment
minLeftinteger or false0minimum Left Offset of 'this'. (false disables this feature)
minTopinteger or false0minimum Top Offset of 'this'. (false disables this feature)

##Compatibility this Version has been tested with jquery 2.0.1 only, but should work on earlier version as well.

You can’t perform that action at this time.