Skip to content

jQuery.paving offers the way to layout same-width/various-height elements neatly packed.

License

Notifications You must be signed in to change notification settings

beatak/jquery-paving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

jQuery.paving()

jQuery.paving() offers a neatly packed layout with same-width/varying-height elements.

DEMO

beatak.github.com/jquery-paving/

EXAMPLE

// for the initial call
$(".PARENT-SELECTOR").paving(OPTIONS);

// after paved, you can still add more elaments to the parent node.
// Then you call this.
$(".PARENT-SELECTOR").paving(
  "append",
  OPTIONS
);

// or if you wanna add the element manually one by one.
$(".YOUR-SELECTOR").paving(
  "add",
  OPTIONS,
  HTML,
  index
);

OPTIONS

The instance options as follows:

Name Type Default Description
selector string ".stone" $.fn.paving() will look for the element to "pave" by the selecetor you pass here.
marking string "paved" After $.fn.paving() set the layout to the elements, it will mark the paved element by the string you pass here with using data attribute.
callback function null Callback function after each element getting its layout. The first argument is the "paved" element. The second argument is the object that holds the pixel height of each column.
finish funciton null Callback function after all paving is done. The first argument is the object that holds the pixel height of each column.

About

jQuery.paving offers the way to layout same-width/various-height elements neatly packed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published