%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tradesc/www/relax/wp-content/themes/flatsome/inc/integrations/wp-rocket/
Upload File :
Create Path :
Current File : /home/tradesc/www/relax/wp-content/themes/flatsome/inc/integrations/wp-rocket/flatsome-wp-rocket.js

/* eslint-disable semi, no-var */
Flatsome.behavior('wp-rocket-lazy-load-packery', {
  attach: function (context) {
    var $lazyLoad = jQuery('.has-packery .lazy-load', context)

    if (!$lazyLoad.length) return

    var observer = new IntersectionObserver(function (entries) {
      entries.forEach(function (entry) {
        if (entry.intersectionRatio > 0) {
          observer.unobserve(entry.target)
          jQuery(entry.target).imagesLoaded(function () {
            jQuery('.has-packery').packery('layout')
          })
        }
      })
    }, {
      rootMargin: '0px',
      threshold: 0.1
    })

    $lazyLoad.each(function (i, el) {
      observer.observe(el)
    })
  }
});

Zerion Mini Shell 1.0