1
I am using the plugin bxslider
. Each slider contains 6 images that are divided into 3 div
, whose classes are item_top
and item_bottom
, for three images from top and bottom, respectively. When I first picked up the static code, it was like this:
<ul>
<li>
<div class="item_top">
<img src="image_1.jpg"/>
</div>
<div class="item_bottom">
<img src="image_2.jpg"/>
</div>
</li>
...
...
</ul>
Every 3 li
shape a slide. The problem is that I now bring these images from the database, so I can’t just add two div
in each li
because otherwise the images will come duplicated. So the code is like this now:
<ul>
<li>
<div class="">
<img src="<?php echo $x['imagem']; ?>"/>
</div>
</li>
...
...
</ul>
I looked for solutions, and the best I found was to remove from HTML as li
, engage with Javascript counting every 2 div
, and then add the classes for each div odd
and even
. This way did not work as desired, because the plugin set the rules for div
instead of li
, and even adding via JS, there were problems.
I need help. If you wish, there is an example of static HTML in this website here, in the "Dealers and Resellers" area, to see how I need you to be visually, coming images from the database.
Let me get this straight, the problem is that through the database you can’t control whether it will come 3 straight or 2 in 2?
– RBoschini
@Rboschini This. The way it is in my code, which is the second block shown, it just displays three images on one slide, and three more on the next. I need this second trio of images to be below the first. Currently each slide should contain 3
li
, and within each, twodiv
with the classes cited, however if it is necessary to modify the structure, and place three images bydiv
, i believe that there will be no problems, I just need it to stay the way it is in the link I passed. :)– fermoga