Last active
December 26, 2015 04:59
-
-
Save ivoba/7097270 to your computer and use it in GitHub Desktop.
bower & masonry & imagesloaded & requirejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['masonry/masonry', 'imagesloaded/imagesloaded'], function(Masonry, imagesLoaded) { | |
$(document).ready(function() { | |
var container = document.querySelector('#masonry'); | |
imagesLoaded(container, function() { | |
var msnry = new Masonry(container, { | |
columnWidth: 200, | |
gutter: 20, | |
itemSelector: '.item', | |
isFitWidth: true | |
}); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "bower-masonry-imagesloaded-requirejs", | |
"version": "0.0.0", | |
"dependencies": { | |
"requirejs": "~2.1.8", | |
"jquery": "~1.10.2", | |
"masonry": "~3.1.2", | |
"imagesloaded": "~3.0.4" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.config({ | |
paths: { | |
jquery: '../bower_components/jquery/jquery', | |
eventie: '../bower_components/eventie', | |
'doc-ready': '../bower_components/doc-ready', | |
eventEmitter: '../bower_components/eventEmitter', | |
'get-style-property': '../bower_components/get-style-property', | |
'get-size': '../bower_components/get-size', | |
'matches-selector': '../bower_components/matches-selector', | |
outlayer: '../bower_components/outlayer', | |
masonry: '../bower_components/masonry', | |
imagesloaded: '../bower_components/imagesloaded' | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment