Advertisement
StraMa87

Swup js WP

Feb 24th, 2021
1,044
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const swup = new Swup({
  2.   linkSelector:
  3.     'a[href^="' +
  4.     document.location.origin +
  5.     '"]:not([data-no-swup]):not([class*="ab-item"]), a[href^="/"]:not([data-no-swup]), a[href^="#"]:not([data-no-swup])',
  6.   containers: ["#swup"],
  7.   animationSelector: '[class^="a-"]',
  8.   cache: false,
  9.   plugins: [
  10.     new SwupGaPlugin(),
  11.     new SwupScrollPlugin(),
  12.     new SwupBodyClassPlugin(),
  13.     new SwupFormsPlugin({ formSelector: 'form[class="wpcf7-form"]' }),
  14.     new SwupHeadPlugin(),
  15.   ],
  16.   skipPopStateHandling: function (event) {
  17.     if (event.state && event.state.source == "swup") {
  18.       return false;
  19.     }
  20.     return true;
  21.   },
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement