Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

BaconFist/jquery-align

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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.

About

Alignment Plugin for jQuery

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors