Hi everyone, finishing up a landing/home page and i’ve made everything responsive EXCEPT the BXSlider.
I’ve tried to find code snippets online to add a responsive breakpoint to the script but it’s either not correct or i’m adding it incorrectly (just breaks the slider).
I’ve seen online people doing stuff like this:
if (windowsize < 630) {
$('.slider-landing').bxSlider({
minSlides: 1,
maxSlides: 1,
moveSlides: 1,
mode: 'fade',
startSlide: 0,
captions: false
});
} else {
$('.slider-landing').bxSlider({
minSlides: 1,
maxSlides: 4,
moveSlides: 1,
mode: 'horizontal',
slideWidth: 280,
startSlide: 0,
slideMargin: 10,
captions: true
But couldn’t get my own solution going.
I just need something like: if the screen is < 630 use slideWidth: 230
Here is the current script i’ve got added. This one is working but no breakpoints on it yet:
$(document).ready(function(){
$('.carousel').bxSlider({
pager: false,
slideMargin: 30,
controls: false,
speed: 60000,
useCSS: false,
ticker: true,
tickerHover: false,
responsive: false,
slideWidth: 360,
minSlides: 1,
maxSlides: 4,
preloadImages: 'visible',
});
});
Hoping someone can spoon-feed me some code