How to continuously animate images in HTML using Bootstrap

I want to showcase 7-8 client images in a continuous loop using a <marquee> tag. The issue is that there is a gap between the last and first images.

Here is the HTML code I have:

<marquee> 
    <ul>
        <li><a href="#"><img src="img/logo1.png" alt=""></a></li>
        <li><a href="#"><img src="img/logo2.png" alt=""></a></li>
        <li><a href="#"><img src="img/logo3.png" alt=""></a></li>
        <li><a href="#"><img src="img/logo4.png" alt=""></a></li>
        <li><a href="#"><img src="img/logo5.png" alt=""></a></li>
        <li><a href="#"><img src="img/logo6.png" alt=""></a></li>
        <li><a href="#"><img src="img/logo7.png" alt=""></a></li>
    </ul>
</marquee>

I've searched online for a solution but haven't found one that works for me.

I found a sample online where the loop only works once, you can check it out here.

Answer №1

UPDATE

Here is a sample code snippet in HTML5.

Personally, I recommend refraining from using the marquee tag.

HTML

<div id="captioned-gallery">
    <figure class="slider">

        <figure>
        <img src="http://lorempixel.com/900/50" />
        <figcaption>1</figcaption>
        </figure>

        <figure>
        <img src="http://lorempixel.com/900/50" />
        <figcaption>2</figcaption>
        </figure>

        <figure>
        <img src="http://lorempixel.com/900/50" />
        <figcaption>3</figcaption>
        </figure>

        <figure>
        <img src="http://lorempixel.com/900/50" />
        <figcaption>4</figcaption>
        </figure>

        <figure>
        <img src="http://lorempixel.com/900/50" />
        <figcaption>5</figcaption>
        </figure>

    </figure>
</div>

CSS

@keyframes slidy {
20% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}

body { margin: 0; } 
div#slider { 
margin: auto;
width: 80%;
max-width: 900px;
border: solid 4px white;
overflow: hidden; }

div#slider figure { 
position: relative;
width: 500%;
margin: 0;
left: 0;
font-size: 0;
animation: 30s slidy infinite; }

div#captioned-gallery { width: 100%; overflow: hidden; }

figure { margin: 0; }

figure.slider {
position: relative; width: 500%;
font-size: 0; animation: 30s slidy infinite; }

figure.slider figure { 
width: 20%; height: auto;
display: inline-block;
position: inherit; }

@media screen and (max-width: 500px) { 
figure.slider figure figcaption { font-size: 1.2rem; }
}

figure.slider figure figcaption {
position: absolute; bottom: -3.5rem;
background: rgba(0,0,0,0.3);
color: #fff; width: 100%;
font-size: 2rem; padding: .6rem;
transition: .5s bottom; }

figure.slider figure:hover figcaption { bottom: 0; }

https://jsfiddle.net/5xrbmaxo/3/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to halt a jQuery function when hovering over it?

Currently, I have a jQuery function set up to run on setInterval(). However, I am looking for a way to pause the interval when hovering over the displayed div and then resume once no longer hovering (i.e., continue cycling through the divs). Does anyone ...

Dealing with cascading jQuery deferred callsHere are some guidelines on

When I have a function that needs to retrieve data and return a promise, I often find myself making multiple requests one after another. This results in nested deffered calls where the last call resolves on the deferred object that the function ultimatel ...

jsonwebtoken does not fetch a token

I've been working on a user registration system using nodejs and sequelize. So far, I've successfully implemented the login and register functionalities. However, I am encountering an issue with getting the token after a successful login. Despit ...

Is it possible to pause the jQuery.each() function until the ajax call inside the loop is finished?

I have a function that includes a jQuery.each loop iterating through all rows of a table. The issue arises because within the loop, there is an ajax call for each row, which means multiple ajax calls may be initiated simultaneously. I would like to modify ...

What is the best way to completely reset a personalized AJAX object?

I've been passing AJAX parameters through a new object and then using that object with jQuery's $.ajax(). However, I'm struggling to fully reset the object. Despite knowing there must be a simple and elegant solution, I haven't been abl ...

Is there a way to create automatic line breaks in this text?

Is there a way to automatically ensure the span spans multiple lines? I am working with HTML and CSS. Below is a modified version of my code, as some parts are in PHP: <div style='border: 1px solid; padding: 10px; margin-top: 5px;'> < ...

I am having difficulty retrieving the JSON object that was sent by the servlet

$(document).ready(function() { var path = null; console.log('${pageContext.request.contextPath}/loadfile'); $.ajax({ dataType: "json", url: '${pageContext.request.contextPath}/loadfile&apos ...

Looking to adjust the API response to fit the necessary JSON format for an Angular project?

A modification is needed in the API response to align with the required JSON format provided below. The current responses and the desired format are detailed for reference. Assistance is appreciated. The current representation of individual's data ne ...

Having trouble with regex failing to capture newlines in sed or perl?

I am currently working on cleaning a CSV file, which involves removing HTML tags within some of the values. I recently found a solution for this issue: by using the following command sed -e 's/<[^>]*>//g' file.html, as suggested in this ...

Are mutations in Vuex guaranteed to be atomic?

I'm currently investigating the atomicity of mutations in Vuex. The code snippet I'm reviewing has me questioning whether the CHANGE_A mutation could potentially be triggered while CHANGE_B is still in progress: const mutations = { [CHANGE_A]( ...

Increase the progress bar at regular intervals of x seconds

I am looking for a jQuery UI progress bar that will increase by x amount every x seconds. Once it reaches 100%, I need it to trigger a function to retrieve some content. Essentially, I need a timer-like feature. EDIT: Note that I do not require any code ...

Warning: An error occurred with undeclared variables... missing variable declaration

Hey everyone, I recently made a post but it seems like my explanation was not clear enough. So here's the issue - I have a products page with a URL structure like http:.......rest_id=3/area='Enfield'. I've been using a similar query on ...

What is the correct way to write the syntax for wp_register_style function in

I'm attempting to include a cache-buster version in my CSS file. The guides mention: <?php wp_register_style( $handle, $src, $deps, $ver, $media ); ?> However, I've scoured Google and Stack Overflow for the correct formatting of these var ...

Channeling requests from webpack dev server to .net MVC website

I am working on incorporating Vue into my .net MVC project. After installing Vue using the CLI, I included the following vue.config.js: module.exports = { devServer: { proxy: { '/': { target: 'http://mvcsite.local', ...

Raising the css value for each element that is impacted

I am faced with an infinite number of elements that I need to arrange next to each other. Each element has a class called "box". My goal is to separate each box by 10px increments, meaning the first element will have a left property of 0px, the second 10px ...

When pasting Arabic text into an input box, the words in HTML appear to be jumbled and shuffled around

When I replicate this text يف عام and input it into a box, the output is shown as follows عام يف ...

Is it possible for the jquery in index.html to retrieve variables stored in the connected controller?

Utilizing jQuery for a dropdown navigation that dynamically adjusts its CSS properties based on the user's login status within the application. The visibility of links in the navigation is determined by the boolean value of the loginStatus variable se ...

Customize CSS to target the first and last elements in a row using flexbox styling

I am facing a challenge in selecting the last element of the first row and the first element of the last row within a flex container. The setup involves a flex-wrap: wrap; for my flex container where all elements have flex: auto; with different sizes. Thi ...

Trouble with CSS styling in Asp.Net MVC dropdown list

I have encountered an issue while trying to apply a CSS class to an ASP.NET MVC dropdown list. The CSS class works fine for the EditorFor case, but not for the DropDownListFor case. I am wondering what could be missing from my code? Here is the working CS ...

Is it possible to incorporate the arrow function within the debounce function?

export const debounce = (callback: Function, ms = 300) => { let timeoutId: ReturnType<typeof setTimeout> return function (...args: any[]) { clearTimeout(timeoutId) timeoutId = setTimeout(() => callback.apply(this, args), ms) ...