The 10 Most Fascinating jQuery Grids

jQuery is usually the first choice for most people who want to dip their feet in JavaScript programming as it provides an easy method to select HTML elements and manipulate the DOM. jQuery is wildly popular, according to the recent stats of W3Techs, “jQuery is used by 95.4% of all the websites whose JavaScript library we know.”

jQuery is also used by many JavaScript libraries as a dependency, and the alpha version of the new major release, jQuery 3.0 is already out there. If your project uses jQuery in any way and you want a dynamic, flexible layout for your design it’s worth to consider to include a jQuery grid plugin into your frontend stack.

How Do jQuery Grids Work?

jQuery grids let you create Pinterest-like layouts for your site. They work like a virtual matrix, they follow the “box inside a box” principle. jQuery grids dynamically calculate what is the best arrangement of items and populate the page with them in a way that leaves the least blank space, something like what you see in these boxes here.

IMAGE: DHomie Home Design Magazine

The main advantage of jQuery grids compared to CSS grids is that they work with images or other media elements that have different widths and heights. Cool JavaScript effects are also a big reason to use jQuery grids to create a modern layout.

In this post you can read about the 10 most fascinating jQuery grids that are currently out on the market – of course, just like jQuery, all of them are open-source and free.

1. jQuery Nested

jQuery Nested provides you with a handy multi-column grid layout that is responsive and works across all kinds of devices. This jQuery plugin advertises itself as completely gap-free. At first this slogan may sound like a cheap marketing trick but the plugin actually accomplishes gap-freedom very nicely, just as its creators promised.

jQuery Nested follows a unique script in populating the grid matrix. First it creates a multi column grid, then it scans the matrix for gaps and fills them by reordering the different elements. Finally – and that is the step that makes this grid gapless – it resizes any element in the bottom row that doesn’t properly fit in the gap.

2. Freewall

Freewall allows you to create the layout you want whether it is an image grid, a nested grid, a masonry or a metro-style grid. It has many options that you can set as JavaScript variables such as gutterX, gutterY, animate, cellW, cellH, etc. It has custom events such as onGapFound and onResize, and custom methods as well.

You can find nice code examples on their website. The devs also cared about the poor souls who still have to design for older browsers, so Freewall supports Internet Explorer 8, and it also has a solution for disabled JavaScript, as it uses CSS 3 animations as a JS fallback strategy. Check out our article on Freewall here.

3. Masonry

The name of the good old Masonry must be familiar to the ears of every experienced designer. In case you haven’t heard of it, Masonry is a cascading grid layout library that works with both jQuery and vanilla JavaScript.

This handy plugin is the base of many popular WordPress themes. You don’t even have to upload it to your server as you can easily link the library directly from a CDN.

<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.1/masonry.pkgd.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.1/masonry.pkgd.min.js">

Masonry is probably the best-established jQuery grid out there, and that’s why it has many options. You can easily install it with Bower or Node Package Manager. You can achieve different grid layouts with its help and you can set many custom variables, methods and events too.

IMAGE: Tumblr Staff Archive (Made with the Masonry plugin)
4. Gridify

Gridify is a lightweight JavaScript plugin that you not only use with jQuery but also with pure JavaScript. The page mentions that it can be used with the YUI library too, but as the development of YUI has been discontinued, it’s not an option any more.

Gridify “gridifies” your layout in a Pinterest-like way. It supports loaded events, calculates item widths dynamically, it handles items with very long heights and makes animations via CSS 3 transitions possible.

Since the latest version you can also use Gridify together with the Require JS JavaScript file and module loader.

5. Shapeshift

Shapeshift is a really cool drag-and-drop jQuery grid system. The user can drag and drop an element throughout the page, and Shapeshift reorganizes the elements into a new position every time an item is moved around.

The dragging event changes the index position of the elements within their parent container. This way Spaceshift doesn’t screw up the logical indexing system of the child elements. Seriously, try it out on their demo website, it works wonderfully.

Shapeshift also works well on touch-enabled devices as it smartly utilizes the jQuery UI Touch Punch app.

6. jQuery Portfolio

The jQuery Portfolio plugin is a great choice if you want to design a stylish portfolio site. The author originally designed it for his own portfolio site but later made it an open-source project.

You can set the number of columns in the grid and the desired jQuery transition effect. The jQuery Portfolio plugin is responsive as well so you don’t have to worry about the user experience of your visitors using a mobile device.

7. jQuery MatchHeight

The jQuery MatchHeight plugin allows you to use a special jQuery grid that makes the height of all selected elements exactly equal. MatchHeight automatically matches the height of elements in the same group, and smartly handles floating elements and wrapping. You can use this plugin for placing items in lovely straight rows.

You can either use a maximum height as a benchmark or define a specific target element and MatchHeight will make sure that other elements won’t be larger than that. It also has a Data API that enables you to use data attributes inside the inline <script> tags in your HTML 5 files.

8. Photoset Grid

Do you like Tumblr’s Photoset feature? Then the Photoset Grid jQuery plugin was designed for you. This handy frontend tool arranges images into a flexible grid based on the aforementioned photoset feature. The original version of the plugin was created for Tumblr themes but the dev team decided to give the opportunity for designers to use this plugin in their own designs.

If you want to add Photoset Grid to your own Tumblr theme, they have a custom code snippet you can embed in your code. Probably the coolest feature of this plugin is the possibility of adding a Lightbox to the image grid. You can try it out here by clicking on one the photos.

9. Shuffle

Have you ever wanted a flexible image grid that enables you to categorize, sort and filter the items? If yes, you definitely need to try out Shuffle. The result of this plugin is really beautiful, especially because it has a cool shuffle effect on page load.

Items can be added to multiple groups and later the user can filter them by groups, so it makes a great user experience. The plugin adds subtle captions to the images that lists the categories the item belongs to. You can set many options with the help of JavaScript variables such as the speed of the shuffle effect, the width of the gutters, the width of the columns, and many other.

10. jQuery Gridly

jQuery Gridly is a smart choice for anyone who wants to implement grid-based layouts on touch-enabled devices. This plugin allows users to drag and drop items around the screen. Both the drag-and-drop and the resize features react to touchscreen gestures too.

Users can close the images they don’t like and after an image is closed the layout is rearranged following by a cool effect. It’s easy to integrate jQuery Gridly with Ruby on Rails apps as it’s also registered as a Rails Asset.