I am working on a css for some images, basically what i want to achieve is that there is a image it should come out of the left side move towards the right side, when it reaches the right end it should again come out of the left side and so on, i was able to achieve this using the following code.
@keyframes slideAnimation {
0% {
transform: translateX(0%);
}
100% {
transform: translateX(100%);
}
}
.row-1 {
overflow: hidden;
display: flex;
flex-direction: column;
align-items: flex-start;
width: 100%;
height: 100%;
}
.image-container {
position: absolute;
top: 4%;
width: 100vw !important;
overflow: hidden;
animation: slideAnimation 18s linear infinite;
}
<div class="row-1">
<div class="image-container">
<img class="img" src="/src/assets/image.svg" alt="img">
</div>
</div>
This works for desktop and not for mobile css it adds scroll to my page even though the image comes out of left again when it reaches the right side but the image container's width is 100vw, and image is in the start of the container and when image reaches the extreme right side there is a scroll that because of the container width, which is effecting my other absolute elements on the page, can i somehow disable that scroll, or achieve the same thing using some different way because its effecting my other absolute elements as well.