Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7054783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:40:08+00:00 2026-05-28T03:40:08+00:00

While testing my web app for iOS, I noticed that CSS3 animations were hardware-accelerated

  • 0

While testing my web app for iOS, I noticed that CSS3 animations were hardware-accelerated and wanted to switch my loading screen over to CSS3 animations.

The loading screen was a simple div that covers the screen:

.loading{
position:fixed;
top:0;
left:0;
right:0;
bottom: 0;
z-index: 10;
background-color:#000;
display: none;
}

The content of my page is loaded via AJAX. The loading div is shown when the page loads, and when the request is made again (so the AJAX request would be reloaded, updating the content). The way I did this was using:

$('.loading').show()

Before everything else, then $('.loading').fadeOout() once the AJAX request was finished.

Then with the reload button, I had the following set up:

$("#reload").on("click", function() {
    $('.loading').fadeIn()
    doAjax("http://google.com");
    $('.loading').delay(300).fadeOut()
});

That way, when the request was reloaded, it would fade in the loading screen, load the AJAX content, wait 300ms, and then fade out the div.

Now, what is the best way to transfer this all over to CSS3 animations? I was helped earlier on SO (by Duopixel) with this problem, and he was able to get this far: http://jsfiddle.net/E2Srk/

The problems with that solution are:

  1. The div isn’t shown on page load. This means there is a few second delay between showing the loading screen.
  2. The loading screen doesn’t fade in when the AJAX request is reloaded. It just shows, then fades out.

If anyone has any ideas on how to fix these problems, or has a better solution, that’d be great.
The

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:40:09+00:00Added an answer on May 28, 2026 at 3:40 am

    Action 1: Enable Fade-In

    By removing transition in your .loading.animated class your fade-in problem will fix.

    Action 2: Enable 3 seconds delay to fade out

    To add 3 second delay I just put removeClass inside setTimeout:

    setTimeout(function(){
        $('.loading').removeClass("animated");
    },3000);
    

    If you like to do it in jQuery style you can use this:

    $('.loading').delay(3000).queue(function(next){
        $(this).removeClass("animated");
        next();
    });
    

    Action 3: Disable Fade-In effect in Page Load

    To disable Fade-in in start I apply a trick by adding new class .firsttime to div which disabled the animation and then remove it after Ajax call, so all other calls will have fade in except first one 😉

    Action 4: Display Loading without delay on Start Up

    To show loading without any delay for first time I added .animated class to your div inside your html so it will show up right aways and won’t wait to JavaScript!

    Action 5: Remove 3 seconds delay on Start Up

    To not delay first time loading, I added a property to doAjax function to check if it’s the first time or not, and if it is, then just remove the class .animated otherwise, add 3 sec delay then delete the class.

    Updated JsFiddle: http://jsfiddle.net/E2Srk/5/

    I hope this fix all of your issues 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While testing my web app, I'd like to be able to set the value
While testing a console app, I set the properties of the console window to
My time zone is CET (Berlin). And while testing Joda's DateTime i noticed some
I'm facing a problem while unit testing my forms. The problem is that data
I am testing a web app where i delete an item from a list.
I have an application that, as any other app, crashes once in a while
I use Firefox in daily use. While testing own web-application in Internet Explorer, I've
I have been using Selenium a lot lately (testing an ExtJs app) and while
I've been testing a small app I've written that basically does a http HEAD
I am writing a testing framework for my web app. The case is to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.