Is there a way to postpone CSS animations? I attempted using animation-delay but it wasn't successful

Is there a way to make my CSS slides appear one after the other? I have created an animation but no matter how much I adjust the animation-delay parameter, it doesn't seem to work. I need the second slide to show up 30 seconds after the first one.

.slideInLeft2 {
  -webkit-animation-name: slideInLeft2;
  animation-name: slideInLeft2;
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  -webkit-animation-delay: 30s; /* adjusted delay for second slide */
}

@-webkit-keyframes slideInLeft2 {
  0% {
    -webkit-transform: translateX(-100%);
    visibility: visible;
  }
  100% {
    -webkit-transform: translateX(0);
  }
}

@keyframes slideInLeft2 {
  0% {
    transform: translateX(-400%);
    visibility: visible;
  }
  100% {
    transform: translateX(0);
  }
}

Answer №1

Seems like there was a small mistake, the time was set to 111 seconds on line 7...

-webkit-animation-delay: 111s;

But it should actually be -

-webkit-animation-delay: 11s;

Answer №2

Modify your code by substituting

animation: fadein 3s ease-in-out;

To include a delay as well, do the following:

animation: fadein 3s ease-in-out 111s;

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

Creating a Seamless Bond Between JavaScript and HTML

I've been struggling to find a helpful and straightforward solution to a simple problem. On my web page, I have five image placeholders that should be filled with one of nine random pictures. To achieve this, I wrote a JavaScript code that generates r ...

Having trouble with the find method when trying to use it with the transform

In my code, I have three div elements with different values of the transform property assigned to them. I store these elements in a variable using the getElementsByClassName method and then try to find the element where the value of the transform property ...

Error: You forgot to include a name after the dot operator

I am facing an issue where I am unable to use YUIcompressor to compress a file. The script is running smoothly, but I am encountering the error missing name after . operator on line 3 of this script: Specifically at: "+ source.response.chars[k].name +" I ...

Sending a request to the controller via AJAX in order to transfer data from a JSP webpage

I'm new to Spring MVC and encountered an error while trying to pass data to a controller using Ajax. Please review the code below and provide any potential solutions. <form class="form-horizontal bucket-form" id="myform" method="post" > ...

How can I turn off bi-directional data binding in Angular?

Utilizing Angular Material's md-dialog, when the user clicks the "edit" button to display the dialog, it takes the current object (a table row) and sends it to the function showDialog, populating the dialog fields with its values: <button ng-class ...

Google Sheets API v4 - Add a Row Above (Not Below)

Is anyone familiar with how to use the insertDimension request to insert a row above existing data? I am having trouble finding documentation on specifying where to add the row within the spreadsheet. The code I have inserts the row at the bottom, and I&ap ...

Problems Arising from Data Visualization in ReactJS Tables with antd

My current project is utilizing ReactJS and the antd library for development. I am encountering an issue with the proper display of data in a table. The columns are displaying correctly, but the rows are not being rendered as expected due to fetching data ...

Transitioning from Webpack version 4 to version 5 resulted in a failure to detect certain styles

After migrating my React project to Webpack v5, I am facing an issue where none of my .scss files are being picked up when I run the project. I meticulously followed the guide on migrating webpack https://webpack.js.org/migrate/5/, updated all plugins and ...

Using Stringify to modify the value of a particular array in Local Storage

Uncertain of the accuracy of my question, but I am attempting to modify a value within a localstorage array. This is what my localstorage currently contains: [{"id":"item-1","href":"google.com","icon":"google.com"}, {"id":"item-2","href":"youtube.com","i ...

Analyze data visualization selections with React on click functionality

Currently, I have implemented a highcharts column chart within my react application and now I am looking to include an onClick event for the chart. Essentially, when a user clicks on a column, my objective is to extract the X and Y axis values and then tri ...

Retrieve the bounding rectangle of a div that has the CSS style `display: contents` using the getBoundingClientRect

My objective is to apply styling and obtain the bounding box of an entire "row" within a CSS grid, including features like highlighting when hovering over it. To achieve the styling aspect, I make use of the display: contents property, so that the styles ...

Send mail using PHP with Ajax

I'm facing an issue with PHP email sending. Below is the form located in the index.php page: <form action=""> <input placeholder="Name" class="form" id="name" type="text" required/> <input placeholder="Email" class="form" id="mail" ty ...

VS code showing live server as installed but failing to function properly

After installing the live server extension, I noticed that my browser is not updating when I save my HTML or other files. What could be causing this issue? ...

Is it required for initializer functions in useState and useReducer to be pure?

Here is a problem I faced and an example of it: import ReactDOM from "react-dom/client"; import React, { useState, useEffect } from "react"; const App = () => { // Issue with initializing state const [radio, setRadio] = useState ...

React JS component experiencing issues with Material UI modal functionality

Attempting to reproduce the material ui modal example has proven to be a challenge for me. Initially, I encountered an error stating "Cannot read property 'setState' of undefined" which I managed to resolve. However, even after resolving this iss ...

Which file should I include: npm-shrinkwrap.json, package-lock.json, or yarn.lock?

When shipping a package that is compiled only using tsc (the typescript compiler), I anticipate that consumers will install the necessary dependencies when they use npm or yarn to install my package. I aim to offer flexibility by not enforcing the use of ...

What is the best way to apply various styles using the ng-style directive in different scenarios?

When working in Angular, I am attempting to apply different style attributes based on varying conditions. However, the typical conditional expression method is limited to just two conditions and is not providing the desired results. <div ng-style=" ...

What steps can be taken to break free from the never-ending cycle of issues and vulnerabilities when starting a new React app or project?

Having just initiated a React project by using npx create-react-app project, I encountered some vulnerabilities that need attention. The initial audit revealed: 162 vulnerabilities (1 low, 122 moderate, 36 high, 3 critical) To fix issues that ...

Troubleshooting issues when testing Angular services using Jasmine and Chutzpah

I've been facing some challenges while attempting to test my AngularJs services with Jasmine as I encounter various errors consistently. In an effort to troubleshoot, I decided to create a simple Sum service for testing purposes but unfortunately, the ...

Issues with CSS styling are affecting the display of a form

Hey there! I was working on creating an order form for my website, and everything was going smoothly until I hit a snag while styling the webpage. The problem is that the legends of the form are extending all the way to the right side of the page, and the ...