bxslider-3 icon indicating copy to clipboard operation
bxslider-3 copied to clipboard

Only one slide - still scrolls

Open leads opened this issue 13 years ago • 4 comments

Hi, unless I'm missing an obvious option, if there is only one slide then, then in the dom it creates 3 and loops between them.

Can I stop that happening? Thanks

leads avatar Jan 20 '12 13:01 leads

You need to check how many potential slides exist before calling BXSlider. You can use the .length utility in jQuery. http://api.jquery.com/length/

Something like:


// If there is more than 1 slide
if ($('.mySlideClass').length > 1)) {
    // Call BS Slider as normal
}

craigmdennis avatar Jan 24 '12 13:01 craigmdennis

but thats a stupid idea to make a check using the dom again through whats already executed. This should be automatically handled within bxslider

scazzy avatar Feb 26 '14 09:02 scazzy

I think that problem has been solved here https://github.com/wandoledzep/bxslider-4/pull/377

magmadiver avatar Feb 27 '14 11:02 magmadiver

thanks @magmadiver for hinting out. should be pulled into master.

scazzy avatar Feb 27 '14 12:02 scazzy