Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(window).load(function(){
- $('body').hide().show(); //fix invisible fonts on refresh.
- //product thumbnails swiper
- var product_thumbnails_swiper = $('.product_thumbnails .product_thumbnails_swiper_container').swiper({
- slidesPerView: "auto",
- watchActiveIndex: true,
- mousewheelControl: true,
- mode:'vertical',
- onSlideClick : function(swiper) {
- owl.goTo(product_thumbnails_swiper.clickedSlideIndex);
- for (var i = 0; i < product_thumbnails_swiper.slides.length; i++){
- product_thumbnails_swiper.slides[i].style.opacity = 0.2;
- product_thumbnails_swiper.slides[i].style.cursor = 'pointer';
- }
- product_thumbnails_swiper.slides[product_thumbnails_swiper.clickedSlideIndex].style.opacity = 1;
- product_thumbnails_swiper.slides[product_thumbnails_swiper.clickedSlideIndex].style.cursor = 'default';
- product_thumbnails_swiper.swipeTo(product_thumbnails_swiper.clickedSlideIndex, 300, '');
- }
- });
- //owl
- var curent_dragging_item;
- $(".featured_img_temp").hide();
- $("#product-images-carousel").owlCarousel({
- singleItem : true,
- autoHeight : true,
- transitionStyle:"fade",
- lazyLoad : true,
- slideSpeed : 300,
- dragBeforeAnimFinish: false,
- afterAction : afterAction,
- beforeUpdate : function() {},
- startDragging:function() {},
- afterMove:function() {}
- });
- //get carousel instance data and store it in variable owl
- var owl = $("#product-images-carousel").data('owlCarousel');
- function afterAction() {
- /*jshint validthis: true */
- $('.product_thumbnails_swiper_container').css('max-height', $('.product_images').height());
- if ($(".product_thumbnails").length) {
- for (var i = 0; i < product_thumbnails_swiper.slides.length; i++){
- product_thumbnails_swiper.slides[i].style.opacity = 0.2;
- }
- product_thumbnails_swiper.slides[this.owl.currentItem].style.opacity = 1;
- product_thumbnails_swiper.swipeTo(this.owl.currentItem, 300, '');
- }
- }
- //Product Gallery zoom
- if ($(".easyzoom").length ) {
- if ( $(window).width() > 1024 ) {
- var $easyzoom = $(".easyzoom").easyZoom({
- loadingNotice: '',
- errorNotice: '',
- preventClicks: false,
- });
- var easyzoom_api = $easyzoom.data('easyZoom');
- $(".variations").on('change', 'select', function() {
- owl.goTo(0);
- easyzoom_api.teardown();
- easyzoom_api._init();
- });
- }
- }
- setTimeout(function() {
- $(".product_thumbnail.with_second_image").css("background-size", "cover");
- $(".product_thumbnail.with_second_image").addClass("second_image_loaded");
- }, 300);
- if ($(window).outerWidth() > 1024) {
- $.stellar({
- horizontalScrolling: false,
- responsive: true
- });
- }
- setTimeout(function(){
- $('.parallax, .single-post-header-bkg').addClass('loaded');
- },150)
- });
Add Comment
Please, Sign In to add comment