fixed masonry bug

This commit is contained in:
Bachir Soussi Chiadmi
2016-02-17 16:43:05 +01:00
parent 61615e12dc
commit b61e69e173
18 changed files with 1815 additions and 19 deletions
+8 -11
View File
@@ -3,7 +3,7 @@ jQuery(document).ready(function($) {
//window scrolls check
$(window).scroll(function() {
var topOfWindow = $(window).scrollTop();
console.log('topOfWindow',topOfWindow);
// console.log('topOfWindow',topOfWindow);
if (topOfWindow > 100) {
$("#top-bar").addClass("reduced");
}
@@ -14,12 +14,12 @@ jQuery(document).ready(function($) {
// init categories content images behaviour
if($('body').is('.categories')){
console.log('hello')
// console.log('hello');
var $diapo = $('<div id="diaporama"></div>');
$("#categories-content")
.before($diapo)
.find('li.project').each(function(index, el) {
console.log(index)
// console.log(index);
$(this)
.addClass('projet-'+index)
.hover(function (e) {
@@ -37,14 +37,11 @@ jQuery(document).ready(function($) {
// init Masonry
var $grid = $('.grid').masonry({
itemSelector: '.grid-block'
// columnWidth: 200
itemSelector: '.grid-block',
transitionDuration: '0.4s'
});
// layout Masonry after each image loads
// $grid.imagesLoaded().progress( function() {
// $grid.masonry('layout');
// });
$grid.imagesLoaded().progress(function(){
$grid.masonry('layout');
});
});