angulargrid

Pinterest like responsive masonry grid system for angular
Homepage:
2 people use it
Author: 3096766?v=3 s-yadav

angulargrid

Pinterest like responsive masonry grid system for angular

Demo url : http://ignitersworld.com/lab/angulargrid/demo1.html

Documentaion on : https://github.com/s-yadav/angulargrid

Usage

  1. Include angulargrid.js <script src="angulargrid.js"></script>

  2. Inject the module on your app var App = angular.module('demoApp', ['angularGrid']);

  3. Use directive as attribute defining the model you want to listen <ul angular-grid="pics"> ..... ..... </ul>

Options (attributes)

grid-width : (Default to 250) minimum width in pixel a coloumn can have, coloumn width will increase above grid width depending on container size to make grids responsive.

gutter-size : (Default to 10) Spacing between two column

refresh-on-img-load : (Default to true) refresh the layout on image load so images does not overlap each other

Handeling Images

If your list contains any image inside, as it will load asynchronously, plugin refresh the layout and add following classes to list item and images, so you can handle transitions of image better,

images : image-loading : when an image is loading inside list item image-loaded : when an image is loaded inside list item

list item : image-loading : when any of image is loading inside list item image-loaded : when all images are loaded inside list item

Optionally if you know dimension of images you can add data-actual-width and data-actual-height attributes, so that it will not refresh the layout when those images are loaded.

Refreshing manually

To get the refrence of instance you need to define angular-grid-id on the element which you can get back by injecting angularGridInstance to any controller or directive.

comments powered by Disqus
This page was last updated over 2 years ago.