Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is bxslider duplicating my divs

My designer put a bxslider to scroll through 3 divs nicely on my page. When the page runs, in the html I see it generates 6 divs on the page. It shows div 3, div2, div1, div3, div2, div1.

Just because the duplicated fields on my page now mess up my programing.

Is that neccesary, and is there any way I can touch the code that it shouldn't duplicate my divs?

The page is full of complex code , with an ajax passing the data-serialize to a post form. Becuase it's all duplicated, now all fields are coming through as 'value,value'. Therefore it's not giving me accurate respones, and well as undefined when it's supposed to be numeric.

My form posts looks like this:

function submitCart () {
$.post(
"scripts/savecart.asp",
$("#form1").serialize()
);}

How could I add that not bx- to it?

like image 344
user1899829 Avatar asked Nov 04 '13 20:11

user1899829


1 Answers

As commented in the source code of bxSlider:

if infinite loop, prepare additional slides

So I was able to fix this by adding infiniteLoop: false to the config object:

$(".js-slider").bxSlider({
    infiniteLoop: false
});
like image 143
gorodezkiy Avatar answered Oct 05 '22 08:10

gorodezkiy