Actually, the question. I need two sliders with different settings. How to do it? The first one I have has this html code:
<ul class="bxslider"> <li> and js:
function bxslider() { $('.bxslider').bxSlider({ infiniteLoop: false }); } Actually, the question. I need two sliders with different settings. How to do it? The first one I have has this html code:
<ul class="bxslider"> <li> and js:
function bxslider() { $('.bxslider').bxSlider({ infiniteLoop: false }); } You did not show the second slider html, but suppose you have it like this:
<ul class="bxslider slider2"> <li> Then to initialize the second slider, you need this js code:
$('.bxslider.slider2').bxSlider({ infiniteLoop: false }); Unfortunately, I don’t know what this function is and at what point it works: function bxslider() , but in most cases the sliders are initialized in the same way, and when you load the page, both sliders will start:
$(document).ready(function() { $('.bxslider.slider1').bxSlider({ infiniteLoop: false }); $('.bxslider.slider2').bxSlider({ infiniteLoop: false }); }); Two sliders:
<ul class="bxslider-1"> ... <ul> <ul class="bxslider-2"> ... <ul> Two appeals to each:
function bxslider() { $('.bxslider-1').bxSlider({ infiniteLoop: false }); } function bxslider() { $('.bxslider-2').bxSlider({ infiniteLoop: true }); } I mean, let's give your slider in any html any class and refer to these classes to initialize and give different settings via API
Source: https://ru.stackoverflow.com/questions/516842/
All Articles