• Resolved Manuel Camargo

    (@sirlouen)


    I’ve detected that Shortcodes Ultimate swiper functions collides with the Elementor swiper function

    When I introduce a Carousel or a Slider shortcode a javascript error appears:
    TypeError: $slider.swiper is not a function

    I’ve tested to disable Elementor and everything is solved, so obviously my suspicions went around this elementor script:
    /wp-content/plugins/elementor/assets/lib/swiper/swiper.js

    Shortcodes ultimate use this function in:
    galleries-shortcodes.js

    I found a poor solution: Just copying the swiper.js file from
    /wp-content/plugins/shortcodes-ultimate/assets/js/swiper.js
    Overwritting the Elementor’s one
    /wp-content/plugins/elementor/assets/lib/swiper/swiper.js

    And it obviously solves the issue (by breaking the Elementor possible sliders)

    According to the Shortcodes Ultimate assets file it’s using the 2.6.1, that is 5 year old version:
    https://github.com/nolimits4web/swiper/releases/tag/v2.6.1

    wp_register_script( 'swiper', plugins_url( 'assets/js/swiper.js', SU_PLUGIN_FILE ), array( 'jquery' ), '2.6.1', true );

    Elementor is using the December’s 2018 version 4.4.6
    https://github.com/nolimits4web/swiper/releases/tag/v4.4.6

    I’m trying to adapt the galleries-shortcodes.js to the latest swiper code, but had not success so far 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • Got the same problem , I’ll try your solution as soon as I can, thanks for your post

    • This reply was modified 6 years, 10 months ago by loubard.

    This problem persists. The plugin author (7months ago) claimed that the plugin will be updated in light of issues like this. However, version 5.6.0 is still using the same swiper JS file in /vendor/swiper as the previous version. I am not sure why the architecture requires use of the possibly outdated swiper.js file (others have noted that the file in /vendor/swiper/swiper.js is roughly 5 years old). But it’s breaking every time it is attempted to be used with Elementor, which (apparently) uses the current swiper.js.

    The only solution I can find is to find something other than the sliders from shortcodes ultimate, for this reason.

    I attempted to replace the “old” swiper with the “new one” (from elementor) – but this didn’t seem to go anywhere.

    Very odd.

    So… It’s not a clean swap.

    the /vendor/swiper js file is built on this e.swiper

    While the updated version is built on slide.swiper

    These changes exist in multiple places throughout the JS file – which could explain the delay in pushing an update for this. You could try a search and replace, but that could get dicey.

    • This reply was modified 6 years, 4 months ago by Tom Estlack.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Slider Swiper JS Collision’ is closed to new replies.