Note that there are some explanatory texts on larger screens.

plurals
  1. PORun query function if screen size is this or that
    primarykey
    data
    text
    <p>hoping someone can help.</p> <p>I'm creating a responsive version of my website and am having issues with the featured work slider. Its using the bxSlider plugin.</p> <p>I've the below function which worlds great, however I need to be able to change the slideWidth option for when an iPhone is in landscape mode. I've tried everything I can via CSS to no avail. Reading the documentation it also states that slideWidth is required for horizontal sliders - which mine is.</p> <p>Any help would be appreciated...</p> <pre><code> $('.bxslider').bxSlider({ minSlides: 1, maxSlides: 3, slideWidth: 310, slideMargin: 20, useCSS: false, hideControlOnEnd: true, infiniteLoop: false, easing: 'easeOutBounce', speed: 1000, nextSelector: '#slider-next', prevSelector: '#slider-prev', nextText: '&gt;', prevText: '&lt;', pager: false }); </code></pre> <hr> <p>Please note: I have tried the following:</p> <pre><code>jQuery(document).ready(function ($) { // Variable to detect window width. var windowWidth = $(window).width(); // Trigger function for a certain window width if (windowWidth&lt;568) { $('.bxslider').bxSlider({ minSlides: 1, maxSlides: 3, slideWidth: XXX, slideMargin: 20, useCSS: false, hideControlOnEnd: true, infiniteLoop: false, easing: 'easeOutBounce', speed: 1000, nextSelector: '#slider-next', prevSelector: '#slider-prev', nextText: '&gt;', prevText: '&lt;', pager: false }); } }); </code></pre> <p>But the main issue is that I still need to run the function on all screen sizes, it's just the slideWidth property that needs to change. Surely there's a way of just changing that to make it some sort of variable? I'm not sure if that's the right term, I'm still learning jQuery. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload