Skip to content

prenaudin/tartare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tartare

An awesome way to render mixed content in a responsive grid.

Display a grid of elements and handle the resizing of them. No fuss here : the library just maximizes the widths of elements of the same height. Go play with your perfect grids and make Josef Müller-Brockmann proud !

Example video

Getting Started

Grab your tartare in one of these magic ways :

In your web page:

<script src="jquery.js"></script>
<script src="src/tartare.js"></script>
<script>
$(function() {
  $('#my-grid').tartare(); // "awesome"
});
</script>

Documentation

Call tartare with customisable options to suit your needs :

$('#my-grid').tartare(
  itemSelector : ".grid-item", // selector to find the grid elements  
  gutter       : 15,           // gutter to add between the grid elements, in pixels
  maxwidth     : 250           // maximum width for the grid elements, in pixels
  )

Public methods are available to refresh or destroy the plugin :

$('#my-grid').tartare('refresh') // forces the grid to recompute
$('#my-grid').tartare('destroy') // destroys tartare

If you need to append or prepend items, use these methods :

$('#my-grid').tartare('append', $el)
$('#my-grid').tartare('prepend', $el)

Add some CSS for lovely transitions (not included in this plugin, the transitions not the love) :

ul li.grid-item {
  transition: left .35s ease, top .35s ease, width .35s ease;
}

Examples

You can see a live demo here : http://prenaudin.github.com/tartare/examples

Author

Made with love by Pierre Renaudin

License

Code released under the MIT license

About

An awesome way to render mixed content in a responsive grid with jQuery

Resources

Stars

Watchers

Forks

Packages

No packages published