Slider Swiper JS Collision
-
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 functionI’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.jsShortcodes ultimate use this function in:
galleries-shortcodes.jsI 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.jsAnd 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.1wp_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.6I’m trying to adapt the galleries-shortcodes.js to the latest swiper code, but had not success so far 🙁
The topic ‘Slider Swiper JS Collision’ is closed to new replies.