JAVASCRIPT   66

gallery.js

Guest on 12th September 2021 10:19:17 AM

  1. $(document).ready(function(){
  2.     $(document).foundation();
  3.  
  4.     var images_loaded = 0;
  5.     var total_images = $(".gallery img").length;
  6.     var percent_slice = 100 / total_images;
  7.     var current_percent = 0;
  8.  
  9.     $(".gallery img").one("load", function() {
  10.         images_loaded++;
  11.         current_percent += percent_slice;
  12.         if(images_loaded == total_images){
  13.             $(".gallery").pycsLayout({
  14.                 gutter: 0,
  15.                 idealHeight: 50,
  16.             });
  17.             $(".loader-wrapper").hide();
  18.         }
  19.     })
  20. });

Raw Paste


Login or Register to edit or fork this paste. It's free.