Hello Community,
I would like to add some arrows on both sides of my testimonial sliders to help to navigate.
Thank you in advance for your help.
in case : dobblecorsica.fr
pw: dobblecorsica
Hello Community,
I would like to add some arrows on both sides of my testimonial sliders to help to navigate.
Thank you in advance for your help.
in case : dobblecorsica.fr
pw: dobblecorsica
It can be done by doing some code customization. please send me a personal message and we can discuss what youâd like
I have tried to add this code :
theme.Quotes = (function() {
var config = {
mediaQuerySmall: âscreen and (max-width: 749px)â,
mediaQueryMediumUp: âscreen and (min-width: 750px)â,
slideCount: 0
};
var defaults = {
accessibility: true,
arrows: true,
dots: false,
autoplay: false,
touchThresold: 20,
autoplaySpeed: 6000,
slidesToShow: 3,
slidesToScroll: 3
};
but is doesnât seem to work
great, are you able to code
so can you please share the theme.js code so i will check and let you know
I send you the last part of my code as it is too long to share
Thankâs in advance for your help.
theme.ProductRecommendations = (function() {
function ProductRecommendations(container) {
var baseUrl = container.dataset.baseUrl;
var productId = container.dataset.productId;
var recommendationsSectionUrl =
baseUrl +
â?section_id=product-recommendations&product_id=â +
productId +
â&limit=4â;
window.performance.mark(
âdebut:product:fetch_product_recommendations.startâ
);
fetch(recommendationsSectionUrl)
.then(function(response) {
return response.text();
})
.then(function(productHtml) {
if (productHtml.trim() === ââ) return;
container.innerHTML = productHtml;
container.innerHTML = container.firstElementChild.innerHTML;
window.performance.mark(
âdebut:product:fetch_product_recommendations.endâ
);
performance.measure(
âdebut:product:fetch_product_recommendationsâ,
âdebut:product:fetch_product_recommendations.startâ,
âdebut:product:fetch_product_recommendations.endâ
);
});
}
return ProductRecommendations;
})();
theme.Quotes = (function() {
var config = {
mediaQuerySmall: âscreen and (max-width: 749px)â,
mediaQueryMediumUp: âscreen and (min-width: 750px)â,
slideCount: 0
};
var defaults = {
canUseKeyboardArrows: false,
type: âslideâ,
slidesToShow: 3
};
function Quotes(container) {
this.container = container;
var sectionId = container.getAttribute(âdata-section-idâ);
this.slider = document.getElementById(âQuotes-â + sectionId);
this.sliderActive = false;
this.mobileOptions = Object.assign({}, defaults, {
canUseTouchEvents: true,
slidesToShow: 1
});
this.desktopOptions = Object.assign({}, defaults, {
slidesToShow: Math.min(
defaults.slidesToShow,
this.slider.getAttribute(âdata-countâ)
)
});
this.initMobileSlider = this._initMobileSlider.bind(this);
this.initDesktopSlider = this._initDesktopSlider.bind(this);
this.mqlSmall = window.matchMedia(config.mediaQuerySmall);
this.mqlSmall.addListener(this.initMobileSlider);
this.mqlMediumUp = window.matchMedia(config.mediaQueryMediumUp);
this.mqlMediumUp.addListener(this.initDesktopSlider);
this.initMobileSlider();
this.initDesktopSlider();
}
Quotes.prototype = Object.assign({}, Quotes.prototype, {
onUnload: function() {
this.mqlSmall.removeListener(this.initMobileSlider);
this.mqlMediumUp.removeListener(this.initDesktopSlider);
this.slideshow.destroy();
},
// eslint-disable-next-line no-unused-vars
onBlockSelect: function(evt) {
var slide = document.querySelector(
â.quotes-slideââ + evt.detail.blockId
);
var slideIndex = Number(slide.getAttribute(âdata-slider-slide-indexâ));
if (this.mqlMediumUp.matches) {
slideIndex = Math.max(
0,
Math.min(slideIndex, this.slideshow.slides.length - 3)
);
}
this.slideshow.goToSlideByIndex(slideIndex);
},
_initMobileSlider: function() {
if (this.mqlSmall.matches) {
this._initSlider(this.mobileOptions);
}
},
_initDesktopSlider: function() {
if (this.mqlMediumUp.matches) {
this._initSlider(this.desktopOptions);
}
},
// eslint-disable-next-line no-unused-vars
_initSlider: function(args) {
if (this.sliderActive) {
this.slideshow.destroy();
this.sliderActive = false;
}
this.slideshow = new theme.Slideshow(this.container, args);
this.sliderActive = true;
}
});
return Quotes;
})();
theme.SlideshowSection = (function() {
var selectors = {
sliderMobileContentIndex: â[data-slider-mobile-content-index]â
};
function SlideshowSection(container) {
var sectionId = container.dataset.sectionId;
this.container = container;
this.eventHandlers = {};
this.slideshowDom = container.querySelector(â#Slideshow-â + sectionId);
this.sliderMobileContentIndex = container.querySelectorAll(
selectors.sliderMobileContentIndex
);
this.slideshow = new theme.Slideshow(container, {
autoplay: this.slideshowDom.getAttribute(âdata-autorotateâ) === âtrueâ,
slideInterval: this.slideshowDom.getAttribute(âdata-speedâ)
});
this._setupEventListeners();
}
return SlideshowSection;
})();
theme.SlideshowSection.prototype = Object.assign(
{},
theme.SlideshowSection.prototype,
{
_setupEventListeners: function() {
this.eventHandlers.onSliderSlideChanged = function(event) {
this._onSliderSlideChanged(event.detail);
}.bind(this);
this.container.addEventListener(
âslider_slide_changedâ,
this.eventHandlers.onSliderSlideChanged
);
},
_onSliderSlideChanged: function(slideIndex) {
var activeClass = âslideshow__text-contentâmobile-activeâ;
this.sliderMobileContentIndex.forEach(function(element) {
if (
Number(element.getAttribute(âdata-slider-mobile-content-indexâ)) ===
slideIndex
) {
element.classList.add(activeClass);
} else {
element.classList.remove(activeClass);
}
});
},
onUnload: function() {
this.slideshow.destroy();
},
onBlockSelect: function(evt) {
if (this.slideshow.adaptHeight) {
this.slideshow.setSlideshowHeight();
}
// Get slideâs index using theme editorâs id
var slide = this.container.querySelector(
â.slideshow__slideââ + evt.detail.blockId
);
var slideIndex = slide.getAttribute(âdata-slider-slide-indexâ);
// Go to selected slide, pause auto-rotate
this.slideshow.setSlide(slideIndex);
this.slideshow.stopAutoplay();
},
onBlockDeselect: function() {
// Resume auto-rotate
this.slideshow.startAutoplay();
}
}
);
window.theme = window.theme || {};
theme.StoreAvailability = (function() {
var selectors = {
storeAvailabilityModalOpen: â[data-store-availability-modal-open]â,
storeAvailabilityModalProductTitle:
â[data-store-availability-modal-product-title]â,
storeAvailabilityModalVariantTitle:
â[data-store-availability-modal-variant-title]â
};
var classes = {
hidden: âhideâ
};
function StoreAvailability(container) {
this.container = container;
this.productTitle = this.container.dataset.productTitle;
this.hasOnlyDefaultVariant =
this.container.dataset.hasOnlyDefaultVariant === âtrueâ;
}
StoreAvailability.prototype = Object.assign({}, StoreAvailability.prototype, {
updateContent: function(variantId) {
var variantSectionUrl =
this.container.dataset.baseUrl +
â/variants/â +
variantId +
â/?section_id=store-availabilityâ;
var self = this;
var storeAvailabilityModalOpen = self.container.querySelector(
selectors.storeAvailabilityModalOpen
);
this.container.style.opacity = 0.5;
if (storeAvailabilityModalOpen) {
storeAvailabilityModalOpen.disabled = true;
storeAvailabilityModalOpen.setAttribute(âaria-busyâ, true);
}
fetch(variantSectionUrl)
.then(function(response) {
return response.text();
})
.then(function(storeAvailabilityHTML) {
if (storeAvailabilityHTML.trim() === ââ) {
return;
}
self.container.innerHTML = storeAvailabilityHTML;
self.container.innerHTML = self.container.firstElementChild.innerHTML;
self.container.style.opacity = 1;
// Need to query this again because we updated the DOM
storeAvailabilityModalOpen = self.container.querySelector(
selectors.storeAvailabilityModalOpen
);
if (!storeAvailabilityModalOpen) {
return;
}
storeAvailabilityModalOpen.addEventListener(
âclickâ,
self._onClickModalOpen.bind(self)
);
self.modal = self._initModal();
self._updateProductTitle();
if (self.hasOnlyDefaultVariant) {
self._hideVariantTitle();
}
});
},
clearContent: function() {
this.container.innerHTML = ââ;
},
_onClickModalOpen: function() {
this.container.dispatchEvent(
new CustomEvent(âstoreAvailabilityModalOpenedâ, {
bubbles: true,
cancelable: true
})
);
},
_initModal: function() {
return new window.Modals(
âStoreAvailabilityModalâ,
âstore-availability-modalâ,
{
close: â.js-modal-close-store-availability-modalâ,
closeModalOnClick: true,
openClass: âstore-availabilities-modalâactiveâ
}
);
},
_updateProductTitle: function() {
var storeAvailabilityModalProductTitle = this.container.querySelector(
selectors.storeAvailabilityModalProductTitle
);
storeAvailabilityModalProductTitle.textContent = this.productTitle;
},
_hideVariantTitle: function() {
var storeAvailabilityModalVariantTitle = this.container.querySelector(
selectors.storeAvailabilityModalVariantTitle
);
storeAvailabilityModalVariantTitle.classList.add(classes.hidden);
}
});
return StoreAvailability;
})();
theme.VideoSection = (function() {
function VideoSection(container) {
container.querySelectorAll(â.videoâ).forEach(function(el) {
theme.Video.init(el);
theme.Video.editorLoadVideo(el.id);
});
}
return VideoSection;
})();
theme.VideoSection.prototype = Object.assign({}, theme.VideoSection.prototype, {
onUnload: function() {
theme.Video.removeEvents();
}
});
theme.heros = {};
theme.HeroSection = (function() {
function HeroSection(container) {
var sectionId = container.getAttribute(âdata-section-idâ);
var hero = â#Hero-â + sectionId;
theme.heros[hero] = new theme.Hero(hero, sectionId);
}
return HeroSection;
})();
window.theme = window.theme || {};
var selectors = {
disclosureLocale: â[data-disclosure-locale]â,
disclosureCurrency: â[data-disclosure-currency]â
};
theme.FooterSection = (function() {
function Footer(container) {
this.container = container;
this.cache = {};
this.cacheSelectors();
if (this.cache.localeDisclosure) {
this.localeDisclosure = new theme.Disclosure(this.cache.localeDisclosure);
}
if (this.cache.currencyDisclosure) {
this.currencyDisclosure = new theme.Disclosure(
this.cache.currencyDisclosure
);
}
}
Footer.prototype = Object.assign({}, Footer.prototype, {
cacheSelectors: function() {
this.cache = {
localeDisclosure: this.container.querySelector(
selectors.disclosureLocale
),
currencyDisclosure: this.container.querySelector(
selectors.disclosureCurrency
)
};
},
onUnload: function() {
if (this.cache.localeDisclosure) {
this.localeDisclosure.destroy();
}
if (this.cache.currencyDisclosure) {
this.currencyDisclosure.destroy();
}
}
});
return Footer;
})();
document.addEventListener(âDOMContentLoadedâ, function() {
var sections = new theme.Sections();
sections.register(âcart-templateâ, theme.Cart);
sections.register(âproductâ, theme.Product);
sections.register(âcollection-templateâ, theme.Filters);
sections.register(âproduct-templateâ, theme.Product);
sections.register(âheader-sectionâ, theme.HeaderSection);
sections.register(âmapâ, theme.Maps);
sections.register(âslideshow-sectionâ, theme.SlideshowSection);
sections.register(âstore-availabilityâ, theme.StoreAvailability);
sections.register(âvideo-sectionâ, theme.VideoSection);
sections.register(âquotesâ, theme.Quotes);
sections.register(âhero-sectionâ, theme.HeroSection);
sections.register(âproduct-recommendationsâ, theme.ProductRecommendations);
sections.register(âfooter-sectionâ, theme.FooterSection);
theme.customerTemplates.init();
// Theme-specific selectors to make tables scrollable
var tableSelectors = â.rte table,â + â.custom__item-innerâhtml tableâ;
slate.rte.wrapTable({
tables: document.querySelectorAll(tableSelectors),
tableWrapperClass: âscrollable-wrapperâ
});
// Theme-specific selectors to make iframes responsive
var iframeSelectors =
â.rte iframe[src*=âYouTubeâ],â +
â.rte iframe[src*=âplayer.vimeoâ],â +
â.custom__item-innerâhtml iframe[src*=âYouTubeâ],â +
â.custom__item-innerâhtml iframe[src*=âplayer.vimeoâ]â;
slate.rte.wrapIframe({
iframes: document.querySelectorAll(iframeSelectors),
iframeWrapperClass: âvideo-wrapperâ
});
// Common a11y fixes
slate.a11y.pageLinkFocus(
document.getElementById(window.location.hash.substr(1))
);
var inPageLink = document.querySelector(â.in-page-linkâ);
if (inPageLink) {
inPageLink.addEventListener(âclickâ, function(evt) {
slate.a11y.pageLinkFocus(
document.getElementById(evt.currentTarget.hash.substr(1))
);
});
}
document.querySelectorAll(âa[href=â#â]â).forEach(function(anchor) {
anchor.addEventListener(âclickâ, function(evt) {
evt.preventDefault();
});
});
slate.a11y.accessibleLinks({
messages: {
newWindow: theme.strings.newWindow,
external: theme.strings.external,
newWindowExternal: theme.strings.newWindowExternal
},
links: document.querySelectorAll(
âa[href]:not([aria-describedby]), .product-single__thumbnailâ
)
});
theme.FormStatus.init();
var selectors = {
image: â[data-image]â,
lazyloaded: â.lazyloadedâ
};
document.addEventListener(âlazyloadedâ, function(evt) {
var image = evt.target;
removeImageLoadingAnimation(image);
if (document.body.classList.contains(âtemplate-indexâ)) {
var mainContent = document.getElementById(âMainContentâ);
if (mainContent && mainContent.children && mainContent.children.length) {
var firstSection = document.getElementsByClassName(âindex-sectionâ)[0];
if (!firstSection.contains(image)) return;
window.performance.mark(âdebut:index:first_image_visibleâ);
}
}
if (image.hasAttribute(âdata-bgsetâ)) {
var innerImage = image.querySelector(selectors.lazyloaded);
if (innerImage) {
var alt = image.getAttribute(âdata-altâ);
var src=innerImage.hasAttribute(âdata-srcâ)
? innerImage.getAttribute(âdata-srcâ)
: image.getAttribute(âdata-bgâ);
image.setAttribute(âaltâ, alt ? alt : ââ);
image.setAttribute(âsrcâ, src ? src : ââ);
}
}
if (!image.hasAttribute(âdata-imageâ)) {
return;
}
});
// When the theme loads, lazysizes might load images before the âlazyloadedâ
// event listener has been attached. When this happens, the following function
// hides the loading placeholders.
function onLoadHideLazysizesAnimation() {
var alreadyLazyloaded = document.querySelectorAll(â.lazyloadedâ);
alreadyLazyloaded.forEach(function(image) {
removeImageLoadingAnimation(image);
});
}
onLoadHideLazysizesAnimation();
document.addEventListener(
âtouchstartâ,
function() {
theme.Helpers.setTouch();
},
{ once: true }
);
if (document.fonts) {
document.fonts.ready.then(function() {
window.performance.mark(âdebut:fonts_loadedâ);
});
}
});
// Youtube API callback
// eslint-disable-next-line no-unused-vars
function onYouTubeIframeAPIReady() {
theme.Video.loadVideos();
theme.ProductVideo.loadVideos(theme.ProductVideo.hosts.youtube);
}
function removeImageLoadingAnimation(image) {
// Remove loading animation
var imageWrapper = image.hasAttribute(âdata-image-loading-animationâ)
? image
: image.closest(â[data-image-loading-animation]â);
if (imageWrapper) {
imageWrapper.removeAttribute(âdata-image-loading-animationâ);
}
}
thanks for code something is missing on this code if possible to add me on staff so i will try
Thank you for your help,
Unfortunately I cannot but can you tell me what is missing ?
i canât see testimonial slider code script
theme.Quotes = (function() {
var config = {
mediaQuerySmall: âscreen and (max-width: 749px)â,
mediaQueryMediumUp: âscreen and (min-width: 750px)â,
slideCount: 0
};
var defaults = {
canUseKeyboardArrows: false,
type: âslideâ,
slidesToShow: 3
};
It should be this part, otherwise with this link you can have the full theme.js
https://docs.google.com/document/d/1wVf5JGw2JPDQb4UWT-Eor4Mz5RBp9a9VZzZur9dTbyQ/edit?usp=sharing
thanks for it
please check optioin
https://kenwheeler.github.io/slick/
or add me on staff so i will quick fix
Thank you !
So I need to add $(â.multiple-itemsâ).slick({ infinite: true, slidesToShow: 3, slidesToScroll: 3 });
But can you tell me after which line or which item in the code ?
Thankâs for the help, however it doesnt work like that, the arrows do not show. Is it correct ?
Do you know why it doesnât show ?