Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ptgamr/google-image-layout

A library help you to build Google like Image Gallery
https://github.com/ptgamr/google-image-layout

css gallery google-images image-gallery

Last synced: 18 days ago
JSON representation

A library help you to build Google like Image Gallery

Awesome Lists containing this project

README

        

'google-image-layout
===================

A library help you to build Google like Image Gallery. Vanilla Javascript

DEMO [http://ptgamr.github.io/google-image-layout/](http://ptgamr.github.io/google-image-layout/)

TUTORIAL [http://trinhtrunganh.com/2014/09/12/google-image-layout.html](http://trinhtrunganh.com/2014/09/12/google-image-layout.html)

Documentation
=============

### Init via Data Attribute
very simple, add your markdown as bellow

```html






...

```

####data-max-height (default 120)
The maximum height of images in the gallery

### API
####.align(element)
`element` the gallery container which contains images

***Important Notice
===================

Thís plugin requires the image's `width` and `height` have to be known in prior to initialization. If you already have that information, put `data-width` & `data-height` to your image tags.

Otherwise, please consider using [imagesLoaded](https://github.com/desandro/imagesloaded) to load the images first

```javascript
var imgLoad = imagesLoaded( document.querySelector('body') );

imgLoad.on( 'progress', function( instance, image ) {
image.img.setAttribute('data-width', image.img.offsetWidth);
image.img.setAttribute('data-height', image.img.offsetHeight);
});

imgLoad.on( 'done', function( instance ) {
GoogleImageLayout.init();
});
```

Todo List
=========
- Responsive support
- Append images (for infinite scrolling, loadmore button)
- More configuration options

## License
MIT license