1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-02-14 21:10:25 +01:00

get masonry working on photos page

This commit is contained in:
Matthias Kretschmann 2013-11-29 21:36:09 +01:00
parent e9df5741a9
commit 70e511fcf5
4 changed files with 26 additions and 25 deletions

View File

@ -101,8 +101,8 @@ module.exports = function(grunt){
], ],
'<%= config.site %>/<%= config.assets.js %>/kremalicious3.min.js': [ '<%= config.site %>/<%= config.assets.js %>/kremalicious3.min.js': [
'bower_components/infinitescroll/index.js', 'bower_components/infinitescroll/index.js',
//'bower_components/masonry/masonry.js', 'bower_components/masonry/index.js',
//'bower_components/imagesloaded/imagesloaded.js', 'bower_components/imagesloaded/imagesloaded.js',
'<%= config.src %>/<%= config.assets.js %>/app.js' '<%= config.src %>/<%= config.assets.js %>/app.js'
] ]
} }

View File

@ -8,6 +8,7 @@ layout: base
{% if page.url contains "/photos" %} {% if page.url contains "/photos" %}
<div class="masonry"> <div class="masonry">
<div class="grid-sizer"></div>
{% endif %} {% endif %}
{% for post in site.categories[page.category] %} {% for post in site.categories[page.category] %}

View File

@ -15,7 +15,7 @@
$(ASAP = function(){ $(ASAP = function(){
//photoGrid.init(); photoGrid.init();
}); });
@ -26,27 +26,27 @@ $(window).load( AfterLoad = function() {
}); });
// var photoGrid = { var photoGrid = {
//
// masonryLayout: function() { masonryLayout: function() {
// var $container = $('#main .masonry'); var $container = $('#main .masonry');
//
// $container.imagesLoaded( function(){ $container.imagesLoaded( function(){
// $container.masonry({ $container.masonry({
// itemSelector : 'article', itemSelector : 'article',
// columnWidth : '.grid-sizer' columnWidth : '.grid-sizer'
// }); });
// }); });
// }, },
//
// init: function(){ init: function(){
// // only fire when photo post present and screen bigger than 480px // only fire when photo page present and screen bigger than 480px
// if ( $('#photos').length > 0 ) { if ( $('.page-photos').length > 0 ) {
// //this.masonryLayout(); this.masonryLayout();
// } }
// } }
//
// } }
var siteEffects = { var siteEffects = {

View File

@ -12,7 +12,7 @@
"dependencies": { "dependencies": {
"jquery": "~2.0.3", "jquery": "~2.0.3",
"picturefill": "~1.2.1", "picturefill": "~1.2.1",
"masonry": "~3.1.2", "masonry": "http://masonry.desandro.com/masonry.pkgd.min.js",
"imagesloaded": "~3.0.4", "imagesloaded": "~3.0.4",
"infinitescroll": "https://raw.github.com/paulirish/infinite-scroll/master/jquery.infinitescroll.js" "infinitescroll": "https://raw.github.com/paulirish/infinite-scroll/master/jquery.infinitescroll.js"
}, },