The website is experiencing difficulties loading in the Safari browser

Check out my website:

I have a unique loading effect on my site, but it seems to be malfunctioning.

Here is the HTML code for the loading effect:

HTML:

<div class="loadingContainer">
   <div class="loading">
      <div class="rect1"></div>
      <div class="rect2"></div>
      <div class="rect3"></div>
      <div class="rect4"></div>
      <div class="rect5"></div>
   </div>
</div>

CSS:

.loadingContainer {
  text-align: center;
  margin: 0 auto;
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-block;
  z-index: 1000;
}
.loadingContainer .loading {
  display: inline-block;
  text-align: center;
}
.loadingContainer .loading > div {
  background-color: #21242e;
  height: 80px;
  width: 6px;
  display: inline-block;
  -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
  animation: stretchdelay 1.2s infinite ease-in-out;
}
.loadingContainer .loading .rect2 {
  -webkit-animation-delay: -1.1s;
  animation-delay: -1.1s;
}
.loadingContainer .loading .rect3 {
  -webkit-animation-delay: -1s;
  animation-delay: -1s;
}
.loadingContainer .loading .rect4 {
  -webkit-animation-delay: -0.9s;
  animation-delay: -0.9s;
}
.loadingContainer .loading .rect5 {
  -webkit-animation-delay: -0.8s;
  animation-delay: -0.8s;
}
.loading i {
  width: 52px;
  height: 60px;
  position: absolute;
  left: 50%;
  margin-left: -21px;
  top: 50%;
  margin-top: -30px;
  font-size: 60px;
  display: inline-block;
}

JS:

  jQuery(window).load(function(){
    jQuery('.loadingContainer').css({'opacity' : 0 , 'display' : 'none'});
  });

In Safari browser, there seems to be an issue where the ".loadingContainer" persists even after the page has loaded, resulting in a blank screen. I need help troubleshooting this problem. Can anyone assist me?

Answer №1

Consider replacing jQuery(window).load(function(){ with this alternative:

$(document).ready(function() {
    // Initiate a fadeout effect on the loading container once the page is fully loaded
    $('.loadingContainer').fadeOut();
});

In my experience, specifying jQuery in the code may not be necessary. By using this example, jQuery will automatically manage the fadeOut() function. Remaining tasks can be executed by core Javascript. I have successfully implemented this code on my website and it functions smoothly across various operating systems, including Android.

Answer №2

Unfortunately, I am unable to replicate the issue you are experiencing. Have you possibly removed the "loadingcontainer" from your website?

In regards to your code, it appears that you will need to properly define the "stretchdelay" animation.

@keyframes stretchdelay {
    from {opacity: 0;}
    to {opacity: 1;}
}
@-webkit-keyframes stretchdelay {
    from {opacity: 0;}
    to {opacity: 1;} 
}

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

Utilizing Tinymce with multiple instances across various languages simultaneously on a single page

I've been struggling to figure out how to create multiple instances of tinymce editor, each in a different language. Unfortunately, tinymce doesn't seem to support this functionality as it changes the language of all instances to match the last c ...

Shortcodes in Wordpress theme limited to posts, not pages. Bespoke design

Currently, I am in the process of creating a theme for my friend. However, I have encountered an issue where shortcodes are only working in Posts and not Pages. Right now, my page.php file is quite basic: <?php get_header(); ?> <?php if (have_po ...

Tips for including a PHP file after the content of a WordPress post

I develop plugins for WordPress and I'm looking to add a PHP content file to the end of post content. Here is an excerpt from my plugin file: add_filter('the_content', 'modlifyContent'); function modlifyContent($content) { g ...

Tips for sharing content within an iframe

Despite my efforts to find a solution, I have been unable to come across one that aligns with my specific situation. I currently have a form for inputting person data. Within this form, there is an iframe containing another form for adding relatives' ...

Transforming the iOS link background color as you scroll

My website features a collection of products displayed within clickable a links styled with display:block for full clickability. However, I've encountered an issue where the background color of the a link changes to an active state color when scrollin ...

Replicate the anchor's functionality (opening in a new window when 'ctl' is pressed) when submitting a form

I have a question that may seem unconventional - Is there a graceful method to replicate the functionality of an anchor tag when submitting a form? I want users to be able to hold down the control key while submitting a form and have the result open in a ...

Using Ember JS to loop over a JSON array of objects and dynamically generate elements

Looking to dynamically generate a dropdown menu with options sourced from a JSON array of objects. Here is an example of the JSON array: var curr_sel = [ {v:"1", n:"USD"}, {v:"2", n:"GBP"}, {v:"3", n:"CAD"}, {v:"4", n:"AUD"}, {v:"5", n ...

Adjust the size of the child div to fit the remaining space within the parent div

I'm dealing with a situation where there are two child divs inside a parent div. The first child div takes up 32% of the width, while the second child div takes up 68% of the width. If I were to set the display of the first child div to "none", how ca ...

Establishing a connection from PHP to an SQL server in HTML

I have an HTML form that I need to use to filter the data in a SQL file. I am having trouble connecting to a local MySQL server and cannot seem to get into the table() function. This is the code I am using: <form id="form_id" action="food_values.php" ...

Adjusting the width of a kendo UI themed text field using CSS

Isn't it fascinating how you can adjust the width of a text box like this? @Html.TextBoxFor(m => m.LoginId, new { @class = "k-textbox", style="width:400px" }) However, I am seeking a more elegant solution. I attempted to implement this in a fres ...

The functionality of Javascript Regular Expressions is not performing as expected

I am currently facing an issue with email validation in JavaScript as it doesn't seem to be working properly. PROBLEM: Even when entering a VALID email address, the alert still shows that my address is faulty... What could I possibly be missing he ...

Steps for Displaying Error Message when Search Result is Not Found in a JavaScript Table

After creating a table using HTML to display student data like name, degree, and profession, I added a search bar for users to find information on a specific student by typing the student's name. If the student is not in the table, a message "Result n ...

Creating multiple instances of Infinite Ajax Scroll on a single page

How can I set up two instances on the same page? I have successfully implemented Infinite AJAX Scroll in a single overflow div but now need to add another overflow div that accesses different data on the same page. I know it's possible, but I haven& ...

Whenever I select a menu item, my intention is to make all the other main menu options disappear

I've been grappling with this issue for quite some time now. My goal is to hide all other main menus whenever I click on one. For instance, if I click on the Discord menu, I want all other menus to disappear except for the sub-menu. Check out the cod ...

how to clean and extract keys from nested strings in javascript

Looking for a way to convert a string of data into a human-readable format using javascript? Want to preserve the nested hierarchy while eliminating unnecessary spaces and commas in the output? Consider this example string: (id, foo bar,category(subCateg ...

Sending data from Ajax to PHP

I've gone through all the previous examples without success, and now I am facing a simple php question. You can find the example here. My goal is to click on a table and have the options displayed as follows: When I explicitly declare the table name ...

best way to save text in an array on C# web platform

[code="C#"] int counter=0; string filename = "Folio-Mapping-Form-" + myinvestorid.Value +".pdf"; counter++; for (int i = 0; i <=counter; i++) { appendfile +=filename; htmlToPdfConverter.ConvertHtml ...

The PushState function automatically decodes URI-encoded hashtags within a URL

Seeking help with pushing a URL containing a URL encoded hashtag for my Twitter client project. It seems that History.js recognizes URI encoded hashtags (%23) as hash parameters in the URL, leading to automatic decoding and no state change when using such ...

The appearance of the page varies between Ubuntu and Windows 7 when viewed on Firefox 31

This situation is completely new to me: The page I designed appears differently on Firefox 31 in Ubuntu (correct): compared to Windows 7 (wrong): I was able to replicate this issue on another Windows 7 machine using FF 31. My HTML and CSS both validate w ...

Ensure the video frame stretches to fit the full width

I am struggling to make my video frame fill the entire width of the screen. Even though I have tried using CSS, the video container does not stretch to the full width as expected. https://i.sstatic.net/kxyE0.png How can I ensure that the video plays acro ...