mirror of
https://github.com/Aroy-Art/Rinkusu.git
synced 2025-04-28 18:17:48 +02:00
Update Masonry plugin and portfolio
This commit is contained in:
parent
77d4252b75
commit
ff604db53f
3 changed files with 61 additions and 29 deletions
|
@ -12,6 +12,21 @@ $(window).on('load', function () {
|
|||
const observer = lozad(); // lazy loads elements with default selector as ".lozad"
|
||||
observer.observe();
|
||||
|
||||
/* ========================================================================= */
|
||||
/* init Masonry for blog list
|
||||
/* ========================================================================= */
|
||||
var grid = document.querySelector('.blog-post');
|
||||
|
||||
if (grid) {
|
||||
var msnry = new Masonry(grid, {
|
||||
percentPosition: true
|
||||
});
|
||||
|
||||
imagesLoaded(grid).on('progress', function() {
|
||||
// layout Masonry after each image loads
|
||||
msnry.layout();
|
||||
});
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
/* Image Preloader
|
||||
|
@ -21,7 +36,6 @@ function imgIsLoaded(imgElement) {
|
|||
$(imgElement).removeClass("unloaded");
|
||||
}
|
||||
|
||||
|
||||
/* ========================================================================= */
|
||||
/* Code Copy Button
|
||||
/* ========================================================================= */
|
||||
|
@ -231,4 +245,4 @@ jQuery(function ($) {
|
|||
counter();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue