mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 01:46:51 +01:00
get masonry working on photos page
This commit is contained in:
parent
e9df5741a9
commit
70e511fcf5
@ -101,8 +101,8 @@ module.exports = function(grunt){
|
||||
],
|
||||
'<%= config.site %>/<%= config.assets.js %>/kremalicious3.min.js': [
|
||||
'bower_components/infinitescroll/index.js',
|
||||
//'bower_components/masonry/masonry.js',
|
||||
//'bower_components/imagesloaded/imagesloaded.js',
|
||||
'bower_components/masonry/index.js',
|
||||
'bower_components/imagesloaded/imagesloaded.js',
|
||||
'<%= config.src %>/<%= config.assets.js %>/app.js'
|
||||
]
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ layout: base
|
||||
|
||||
{% if page.url contains "/photos" %}
|
||||
<div class="masonry">
|
||||
<div class="grid-sizer"></div>
|
||||
{% endif %}
|
||||
|
||||
{% for post in site.categories[page.category] %}
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
$(ASAP = function(){
|
||||
|
||||
//photoGrid.init();
|
||||
photoGrid.init();
|
||||
|
||||
});
|
||||
|
||||
@ -26,27 +26,27 @@ $(window).load( AfterLoad = function() {
|
||||
|
||||
});
|
||||
|
||||
// var photoGrid = {
|
||||
//
|
||||
// masonryLayout: function() {
|
||||
// var $container = $('#main .masonry');
|
||||
//
|
||||
// $container.imagesLoaded( function(){
|
||||
// $container.masonry({
|
||||
// itemSelector : 'article',
|
||||
// columnWidth : '.grid-sizer'
|
||||
// });
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// init: function(){
|
||||
// // only fire when photo post present and screen bigger than 480px
|
||||
// if ( $('#photos').length > 0 ) {
|
||||
// //this.masonryLayout();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
var photoGrid = {
|
||||
|
||||
masonryLayout: function() {
|
||||
var $container = $('#main .masonry');
|
||||
|
||||
$container.imagesLoaded( function(){
|
||||
$container.masonry({
|
||||
itemSelector : 'article',
|
||||
columnWidth : '.grid-sizer'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
init: function(){
|
||||
// only fire when photo page present and screen bigger than 480px
|
||||
if ( $('.page-photos').length > 0 ) {
|
||||
this.masonryLayout();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var siteEffects = {
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
"dependencies": {
|
||||
"jquery": "~2.0.3",
|
||||
"picturefill": "~1.2.1",
|
||||
"masonry": "~3.1.2",
|
||||
"masonry": "http://masonry.desandro.com/masonry.pkgd.min.js",
|
||||
"imagesloaded": "~3.0.4",
|
||||
"infinitescroll": "https://raw.github.com/paulirish/infinite-scroll/master/jquery.infinitescroll.js"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user