1. New
  2. Categories
  3. Surprise
  4. Videos
  5. Colors
Log in



The Wookmark jQuery plugin

We have received several questions about how the grid layout on wookmark.com is created so we created this simple plugin. It lays out a series of elements in a dynamic column grid.

Mentioned by Web Appers, Design Shack, Web Design Ledger, SpeckyBoy, Queness, Web Resources Depot, HongKiat, DevSnippets, CodeVisually, How Design, Tympanus, David Walsh, JaxEnter and others.

How to use it

  1. Download the Javascript plugin file from the Github repository
  2. Include the file in your website (after your include of jQuery)

  3. Run it on your content

  4. Adjust the options (all optional, see GitHub for examples)

    • align - "left", "right", or "center"
    • autoResize - if "true", updates layout after browser is resized
    • resizeDelay - default is "50", time in miliseconds between browser resize and layout update
    • comparator - a custom sorting function
    • container - the width of this element is used to calculate the number of columns, defaults to "window". For example $('myContentGrid'). Container should also have the CSS property "position: relative".
    • direction - "left" or "right", whether to start in top left or top right corner
    • ignoreInactiveItems - if "true", inactive items will still be visible, which can be used to fade filtered items out
    • itemWidth - width of one grid item in pixels ("200") or percentage ("10%"), defaults to width of first item
    • fillEmptySpace - if "true", creates placeholder at bottom of each column to create an even layout. Placeholders elements have the class "wookmark-placeholder".
    • flexibleWidth - "true" or "false", adjusts item width to create optimal layout based on browser size
    • offset - vertical and horizontal distance between items, defaults to 2
    • onLayoutChanged - a function that gets called after every layout change
    • outerOffset - default is "0"

See examples (sorting, filtering, stamping, endless scroll, lightbox, API integration...) and contribute, Wookmark on github. Have fun.

Wookmark jQuery plugin example

A live example

Below are the current 20 most popular images on wookmark.com. The Wookmark plugin detects the size of the window and automatically organizes the images into columns. Resize your browser to see the layout adjust. Note how the columns are approximately of equal height.

  • Daily Inspiration #1851 | Abduzeedo Design Inspiration
  • tumblr_narsuadnzZ1rq9ek2o1_500.jpg (JPEG Image, 500 × 750 pixels) - Scaled (92%)
  • Wayward Girl
  • 17a24eb70734596d6f21058.jpg (JPEG Image, 500 × 750 pixels) - Scaled (92%)
  • 30639494c03a4aa46d02a68.jpg (JPEG Image, 480 × 635 pixels)
  • ...z31... on
  • tumblr_na3k3ePYrj1t1cy7no1_500.jpg (JPEG Image, 500 × 750 pixels) - Scaled (92%)
  • Salida Wine Festival on Inspirationde
  • Leos by Martin Schmetzer
  • tumblr_maw7quqf181qb7yfso1_1280.jpg (JPEG ??, 683x1024 px)
  • Daily Inspiration #1852 | Abduzeedo Design Inspiration
  • Outline Vehicles Logo on Inspirationde
  • tumblr_n4pc96eHXi1qiln3no1_1280.jpg (JPEG Image, 600 × 800 pixels) - Scaled (86%)
  • tumblr_n2jjxxc59b1sjdj07o1_500.jpg (JPEG Image, 500 × 677 pixels)
  • 13812_inspiration_bundle2-o1.jpg (1160×772)
  • Logos / LOGO DESIGN II on Behance
  • d559e985fb54773ca6208e.jpg (JPEG Image, 706 × 1235 pixels) - Scaled (59%)
  • sentilo-screenshot.png (3234×6948)
  • *iamgreen | (via Image Spark - Loganbmt)
  • Gallery: 25 Beautiful Illustrations, Paintings & Drawings