Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple CSS Animations Not Delaying & Actioning Properly

Featured Replies

Hi Guys,

 

Sorry to be bothering the forum again. I've delayed in trying to fix myself but I'm not having much luck. I'm trying to add a second animation 'add a background-color & border-bottom' to an element via my nofade class which activates my addbottomborder keyframe. The really strange thing is dependant on what you put here it works or not.

 

In my html I have:

	<h5 class="zoomout">Fast</h5>
	<h5 class="zoomout">Accurate</h5>
	<h5 class="zoomout">Reliable</h5>
	<h5 class="zoomout nofade">RC ESTIMATING LTD</h5>
@keyframes zoomout{
	0% {transform: scale(1)}
	100% {transform: scale(0.90); opacity: 100;}
}

h5.zoomout {
	width: 100%;
	text-align: center;
	top: 45%;
	padding: 0;
	margin: 0;
	position: absolute;
	display: inline-block;
	animation-name: zoomout;
	animation-duration: 3s;
	opacity: 0;
	font-size: 4em;
}

@keyframes addbottomborder {
	from {background-color: transparent; border-bottom: 0;}
	to {background-color: red; border-bottom: 5px solid grey !important;}
}

h5.nofade {
	animation-fill-mode: forwards;
	animation-name: zoomout, addbottomborder;
	animation-delay: 12s, 15s;
	animation-duration: 3s, 1s;
}

The delay is not working on the second animation addbottomborder. Technically the background-color: red; should not come in until right at the end and no matter what I try I can't get the border-bottom to activate on the second animation nofade.

Originally I thought that the second animation was not activating at all but the backgroud-color is brought in; however it's not at the correct time. It should be after the 1st animation has finished.

 

Can anyone point out what's going on? I have the page live here.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.