Because < marquee> tag became deprecated, I tried changing my slider to do the same function but using CSS. This is my css code:
<style>
.marquee{
width: 80%;
overflow: hidden;
border:1px solid #ccc;
}
.brandSlider{
display: flex;
list-style: none;
animation: scrollingSlider 20s linear infinite;
}
.barndSliderItem{
height: 250px;
width: 250px;
margin-left: 10px;
}
.brandSliderContainer{
width: 90%;
overflow: hidden;
}
@keyframes scrollingSlider {
0% {transform: translateX(100%);}
100% {transform: translateX(-3000px);}
}
</style>
It works good and moving, but i want the first image appear directly after the last image without any spaces or delay, how to do that?
The images used in slider retrieved from database, this is the html with php code:
<div class="brandSliderContainer">
<div class="brandSlider">
<?php
$sql="select logo,id,website,name from companies where state=1 order by id asc";//get brands from database
$preProd=$con->prepare($sql);
$preProd->execute();
if($preProd->rowcount())
{
$allBrands=$preProd->fetchall();
foreach($allBrands as $img){
$id1=encript_id($img["id"]);
echo "
<a href='brand-products.php?id=$id1'><img class='barndSliderItem' src='../control-panel/images/$img[logo]' alt='Brand Logo'></a>";
}
}
?>
</div>
</div>
The $con is database connection with PDO, the images retrieved successfully.