I'm using the bxslider
plugin. Each slider contains 6 images that are divided into 3 div
, whose classes are item_top
and item_bottom
, for three images from above and below, respectively. When I first got the static code, it looked 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
forms a slide. The problem is that I now bring these images from the database, so I can not simply add two div
to each li
otherwise the images will be duplicated. So, the code looks like this now:
<ul>
<li>
<div class="">
<img src="<?php echo $x['imagem']; ?>"/>
</div>
</li>
...
...
</ul>
I searched for solutions, and the best I found was to remove li
from HTML, engage with JavaScript by counting every 2 div
, and then add classes for each odd
and even
div. This way it did not work as it wished, 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 site here , in the "Dealers and Resellers" area, to see how I need to be visually , coming images from the database.