Skip to content

Returning error n is not a function #9

Open
@karltud123

Description

@karltud123

Checks

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions