fixed masonry bug
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user