splide-extension-auto-scroll icon indicating copy to clipboard operation
splide-extension-auto-scroll copied to clipboard

Returning error `n is not a function`

Open karltud123 opened this issue 1 year ago • 1 comments

Checks

  • [X] Not a duplicate.
  • [X] Not a question, feature request, or anything other than a bug report directly related to Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions

Version

0.5.3

Description

Script returning error.

image

Below is the script that loads the splide.

      $(".splide.media-scroller", context).once("splide-init").each(function () {
        new Splide($(this).get(0), {
          type: 'loop',
          drag: 'free',
          focus: 'center',
          perPage: 3,
          autoScroll: {
            speed: 0.5,
          },
          gap: "1.5rem",
          pagination: false,
          arrows: false,
          padding: "1.5rem",
          mediaQuery: 'min',
          fixedWidth: '65%',
          breakpoints: {
            576: {
              fixedWidth: "41%",
            },
            992: {
              fixedWidth: "30%",
            },
            1200: {
              fixedWidth: "17%",
            },
          }
        }).mount(window.splide.Extensions);
      });

Reproduction Link

No response

Steps to Reproduce

  1. Create splide markup.
  2. Init the splide using the below code.
      $(".splide.media-scroller", context).once("splide-init").each(function () {
        new Splide($(this).get(0), {
          type: 'loop',
          drag: 'free',
          focus: 'center',
          perPage: 3,
          autoScroll: {
            speed: 0.5,
          },
          gap: "1.5rem",
          pagination: false,
          arrows: false,
          padding: "1.5rem",
          mediaQuery: 'min',
          fixedWidth: '65%',
          breakpoints: {
            576: {
              fixedWidth: "41%",
            },
            992: {
              fixedWidth: "30%",
            },
            1200: {
              fixedWidth: "17%",
            },
          }
        }).mount(window.splide.Extensions);
      });
  1. Open console log to see the error.

Expected Behaviour

There shouldnt be any javascript error.

karltud123 avatar Feb 28 '23 04:02 karltud123