| @@ -4,9 +4,13 @@ | ||
| 4 | 4 | |
| 5 | 5 | var pcp_container = $(this), |
| 6 | 6 | pcp_container_id = pcp_container.attr('id'), |
| 7 | 7 | PCP_Wrapper_ID = '#' + pcp_container_id, |
| 8 | + // pc_sid = $(PCP_Wrapper_ID).data('sid'), // The Shortcode ID. | |
| 8 | 9 | pcpCarousel = $('#' + pcp_container_id + ' .sp-pcp-carousel'), |
| 10 | + /* pcpfilter = $('#' + pcp_container_id + '.pcp-filter-wrapper'), | |
| 11 | + ajaxurl = sppcp.ajaxurl, | |
| 12 | + nonce = sppcp.nonce, */ | |
| 9 | 13 | pcpCarouselData = pcpCarousel.data('carousel'); |
| 10 | 14 | if (pcpCarousel.length > 0) { |
| 11 | 15 | // Carousel Swiper for Standard mode. |
| 12 | 16 | var pcpSwiper = new Swiper('#' + pcp_container_id + ' .sp-pcp-carousel', { |
| @@ -16,9 +20,8 @@ | ||
| 16 | 20 | loop: pcpCarouselData.loop, |
| 17 | 21 | loopFillGroupWithBlank: true, |
| 18 | 22 | autoHeight: pcpCarouselData.autoHeight, |
| 19 | 23 | simulateTouch: pcpCarouselData.simulateTouch, |
| 20 | - freeMode: pcpCarouselData.freeMode, | |
| 21 | 24 | allowTouchMove: pcpCarouselData.allowTouchMove, |
| 22 | 25 | centeredSlides: pcpCarouselData.center_mode, |
| 23 | 26 | mousewheel: pcpCarouselData.slider_mouse_wheel, |
| 24 | 27 | lazy: pcpCarouselData.lazy, |
| @@ -114,22 +117,22 @@ | ||
| 114 | 117 | if (pcpCarouselData.autoplay === false) { |
| 115 | 118 | pcpSwiper.autoplay.stop() |
| 116 | 119 | } |
| 117 | 120 | if (pcpCarouselData.stop_onHover && pcpCarouselData.autoplay) { |
| 118 | - $(pcpCarousel).on({ | |
| 119 | - mouseenter: function () { | |
| 120 | - pcpSwiper.autoplay.stop(); | |
| 121 | - }, | |
| 122 | - mouseleave: function () { | |
| 123 | - pcpSwiper.autoplay.start(); | |
| 124 | - } | |
| 125 | - }); | |
| 121 | + $(pcpCarousel).hover( | |
| 122 | + function () { | |
| 123 | + pcpSwiper.autoplay.stop() | |
| 124 | + }, | |
| 125 | + function () { | |
| 126 | + pcpSwiper.autoplay.start() | |
| 127 | + } | |
| 128 | + ) | |
| 129 | + } | |
| 130 | + $(window).resize(function () { | |
| 131 | + pcpSwiper.update() | |
| 132 | + }) | |
| 133 | + $(window).trigger("resize") | |
| 126 | 134 | } |
| 127 | - $(window).on('resize', function () { | |
| 128 | - pcpSwiper.update() | |
| 129 | - }) | |
| 130 | - $(window).trigger("resize") | |
| 131 | - } | |
| 132 | 135 | |
| 133 | 136 | /** |
| 134 | 137 | * Grid masonry. |
| 135 | 138 | */ |