BJQS multiple instances of slider when resizing window
Asked Answered
S

1

6

I want to resize bjqs slider when the window resizes..

this is what i've got so far:

<script type="text/javascript">
$(document).ready(function() {

    $(window).resize(function(){
        $('.pagebg').bjqs({
            height      : 347,
            width       : $(window).width(),
            showcontrols : false,
            showmarkers : false,
         });
     });
});
</script>

I've tried to resize it using $(window).resize, but there are multiple instances running

does anyone know how I can resize it and keep only 1 instance running?

Schilit answered 21/8, 2013 at 14:5 Comment(1)
AHH! Sorry I confused 2 questions!Christine
H
0

Without using window resize event you can define you slider with a width option of 100% like:

$(function () {
    $('#dialog').bjqs({
        'showmarkers': false,
            'responsive': true,
            'width': '100 %',
            'automatic': true
    });
});

So it will be automatically responsive without handle its resize.

Demo: http://jsfiddle.net/IrvinDominin/MADrg/

Hat answered 23/8, 2013 at 13:40 Comment(1)
Do you know how to preserve the aspect ratio of the image?Castile

© 2022 - 2024 — McMap. All rights reserved.