vladshcherbin / imagesloaded

Images loaded js wrapper for meteor. Detect when images have been loaded! With no cache support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImagesLoaded Meteor Wrapper

Table of contents

About

ImagesLoaded wrapper for Meteor.

The package includes only core js file with no cache fix.

The removed cache fixes the mobile chrome bug with image overlaying.

Installation

meteor add shcherbin:imagesloaded

Usage

You can view all available options on the imagesLoaded website.

Example

Spacebars template

<template name="photosIsotope">
	<ul class="unstyled" id="isotope-body">
		{{#each photos}}
			<li class="item">
				<img src="/img/photos/{{slug}}.jpg" alt="{{title}}">
			</li>
		{{/each}}
	</ul>
</template>

Client js files

Template.photosIsotope.helpers({
	photos: function () {
		return Photos.find();
	}
});

Template.photosIsotope.rendered = function () {
	var container = $('#isotope-body').isotope({
		itemSelector: '.item',
		masonry: {
			columnWidth: '.item'
		}
	});

	container.imagesLoaded(function () {
		container.isotope('layout');
	});
};

About

Images loaded js wrapper for meteor. Detect when images have been loaded! With no cache support.


Languages

Language:JavaScript 100.0%