How to use the vanilla-lazyload/dist/lazyload function in vanilla-lazyload

To help you get started, we’ve selected a few vanilla-lazyload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AdventureLookup / AdventureLookup / app / Resources / webpack / js / adventures.js View on Github external
(function () {
  if (!$("#search-results").length) {
    return;
  }

  const myLazyLoad = new LazyLoad();

  // Load more adventures
  let currentPage = 1;
  const $loadMoreBtn = $("#load-more-btn");
  $loadMoreBtn.click(function () {
    $loadMoreBtn.attr("disabled", true);
    $loadMoreBtn.find(".fa-spin").removeClass("d-none");

    const $searchForm = $("#search-form");
    const data = $searchForm.serialize() + "&page=" + ++currentPage;
    $.ajax({
      method: "POST",
      url: $searchForm.attr("action"),
      data: data,
    })
      .done(function (result) {
github department-of-veterans-affairs / vets-website / src / applications / static-pages / static-pages-entry.js View on Github external
});

createDisabilityFormWizard(store, widgetTypes.DISABILITY_APP_STATUS);

createFacilityListWidget();
createFacilityDetailWidget();
createBasicFacilityListWidget();
createFacilityPatientSatisfactionScoresWidget();

// homepage widgets
if (location.pathname === '/') {
  createMyVALoginWidget(store);
}

/* eslint-disable no-unused-vars,camelcase */
const lazyLoad = new LazyLoad({
  elements_selector: '.lazy',
});
/* eslint-enable */

vanilla-lazyload

LazyLoad is a lightweight (2.4 kB) and flexible script that speeds up your web application by deferring the loading of your below-the-fold images, videos and iframes to when they will enter the viewport. It's written in plain "vanilla" JavaScript, it leve

MIT
Latest version published 9 months ago

Package Health Score

77 / 100
Full package analysis

Popular vanilla-lazyload functions