How to show page after progress bar is loaded
1. Idea: Add many pictures to delay the loading time and display the pictures after loading. Define an outer layer p to cover the picture, introduce the picture displayed when loading into the inner layer p, center the inner layer p on the page, use the setInterval timer to set the outer layer p after 3 seconds, and then hide the outer layer p to display the picture. Display the effect of the page after loading.
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> .loading{ width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 100; background: #fff; } .loading .pic{ width: 64px; height: 64px; background: url(loading.gif); position: absolute; top: 0; left: 0; bottom: 0; right: 0; margin: auto; } </style> </head> <body> <img src="http://img5.imgtn.bdimg.com/it/u=4244789527,2286705620&fm=200&gp=0.jpg"> <img src="http://img5.imgtn.bdimg.com/it/u=4224538646,2973769633&fm=200&gp=0.jpg"> <img src="http://img2.imgtn.bdimg.com/it/u=3965705221,2010595691&fm=27&gp=0.jpg"> <img src="http://img4.imgtn.bdimg.com/it/u=1742626185,2547278809&fm=27&gp=0.jpg"> <img src="http://img0.imgtn.bdimg.com/it/u=3597382613,1842885761&fm=27&gp=0.jpg"> <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript"> $(function(){ var loading='<p class="loading"><p class="pic"></p></p>'; $('body').append(loading); setInterval(function(){ $('.loading').fadeOut(); },3000) }) </script> </body> </html>
Knowledge points:
p Centering:
position: absolute; top: 0; left: 0; bottom: 0; right: 0; margin: auto;
2.
Idea: Use the method of state event monitoring: onreadystatechange, judge redayState, and achieve the effect of displaying the page after loading
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> .loading{ width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 100; background: #fff; } .loading .pic{ width: 64px; height: 64px; background: url(loading.gif); position: absolute; top: 0; left: 0; bottom: 0; right: 0; margin: auto; } </style> </head> <body> <p class="loading"> <p class="pic"></p> </p> <img src="http://img5.imgtn.bdimg.com/it/u=4244789527,2286705620&fm=200&gp=0.jpg"> <img src="http://img5.imgtn.bdimg.com/it/u=4224538646,2973769633&fm=200&gp=0.jpg"> <img src="http://img2.imgtn.bdimg.com/it/u=3965705221,2010595691&fm=27&gp=0.jpg"> <img src="http://img4.imgtn.bdimg.com/it/u=1742626185,2547278809&fm=27&gp=0.jpg"> <img src="http://img0.imgtn.bdimg.com/it/u=3597382613,1842885761&fm=27&gp=0.jpg"> <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript"> document.onreadystatechange=function(){ if(document.redayState=='complete'){ $('loading').fadeOut(); } } </script> </body> </html>
Knowledge points:
Monitor the status of readyState through the onreadystatechange event. We only need to care about the last status 'complete'. When the complete status is reached, it means the loading is successful.
3.
Idea: Use CSS3 to achieve animation effects and display the page after loading. The same method of monitoring the onreadystatechange event is used, but the difference is that a dynamic effect is achieved.
Use the i tag and add CSS styles to achieve 5 spaced rectangles. Use animation to loop every 1.2s, infinite loop. Each i tag stretches and shortens in the Y direction with a delay of 0.1s to achieve an animation effect.
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> .loading{ width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 100; background: #fff; } .loading .pic{ width: 50px; height: 50px; position: absolute; top: 0; left: 0; bottom: 0; right: 0; margin: auto; } .loading .pic i{ display: block; float: left; width: 6px; height: 50px; background: #399; margin: 0 2px; -webkit-transform: scaleY(0.4); -ms-transform: scaleY(0.4); transform: scaleY(0.4); -webkit-animation: load 1.2s infinite; animation: load 1.2s infinite; } .loading .pic i:nth-child(2){ -webkit-animation-delay: 0.1s; animation-delay: 0.1s; } .loading .pic i:nth-child(3){ -webkit-animation-delay: 0.2s; animation-delay: 0.2s; } .loading .pic i:nth-child(4){ -webkit-animation-delay: 0.3s; animation-delay: 0.3s; } .loading .pic i:nth-child(5){ -webkit-animation-delay: 0.4s; animation-delay: 0.4s; } @-webkit-keyframes load{ 0%,40%,100%{ -webkit-transform: scaleY(0.4); transform: scaleY(0.4); } 20%{ -webkit-transform: scaleY(1); transform: scaleY(1); } } @keyframes load{ 0%,40%,100%{ -webkit-transform: scaleY(0.4); transform: scaleY(0.4); } 20%{ -webkit-transform: scaleY(1); transform: scaleY(1); } } </style> </head> <body> <p class="loading"> <p class="pic"> <i></i> <i></i> <i></i> <i></i> <i></i> </p> </p> <img src="http://img5.imgtn.bdimg.com/it/u=4244789527,2286705620&fm=200&gp=0.jpg"> <img src="http://img5.imgtn.bdimg.com/it/u=4224538646,2973769633&fm=200&gp=0.jpg"> <img src="http://img2.imgtn.bdimg.com/it/u=3965705221,2010595691&fm=27&gp=0.jpg"> <img src="http://img4.imgtn.bdimg.com/it/u=1742626185,2547278809&fm=27&gp=0.jpg"> <img src="http://img0.imgtn.bdimg.com/it/u=3597382613,1842885761&fm=27&gp=0.jpg"> <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript"> document.onreadystatechange=function(){ if(document.redayState=='complete'){ $('loading').fadeOut(); } } </script> </body> </html>
Knowledge points:
1.scale: elongation and contraction. scaleX:x direction. scaleY: y direction.
2.infinite: infinite loop
3.animate-delay:0.1s delay 0.1s
4.@keyframes animation name{
0%{
}
100%{
}
}
The above is the detailed content of How to show page after progress bar is loaded. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When you click the search field in Windows 11, the search interface automatically expands. It displays a list of recent programs on the left and web content on the right. Microsoft displays news and trending content there. Today's check promotes Bing's new DALL-E3 image generation feature, the "Chat Dragons with Bing" offer, more information about dragons, top news from the Web section, game recommendations, and the Trending Search section. The entire list of items is independent of your activity on your computer. While some users may appreciate the ability to view news, all of this is abundantly available elsewhere. Others may directly or indirectly classify it as promotion or even advertising. Microsoft uses interfaces to promote its own content,

Want to copy a page in Microsoft Word and keep the formatting intact? This is a smart idea because duplicating pages in Word can be a useful time-saving technique when you want to create multiple copies of a specific document layout or format. This guide will walk you through the step-by-step process of copying pages in Word, whether you are creating a template or copying a specific page in a document. These simple instructions are designed to help you easily recreate your page without having to start from scratch. Why copy pages in Microsoft Word? There are several reasons why copying pages in Word is very beneficial: When you have a document with a specific layout or format that you want to copy. Unlike recreating the entire page from scratch
![Error loading plugin in Illustrator [Fixed]](https://img.php.cn/upload/article/000/465/014/170831522770626.jpg?x-oss-process=image/resize,m_fill,h_207,w_330)
When launching Adobe Illustrator, does a message about an error loading the plug-in pop up? Some Illustrator users have encountered this error when opening the application. The message is followed by a list of problematic plugins. This error message indicates that there is a problem with the installed plug-in, but it may also be caused by other reasons such as a damaged Visual C++ DLL file or a damaged preference file. If you encounter this error, we will guide you in this article to fix the problem, so continue reading below. Error loading plug-in in Illustrator If you receive an "Error loading plug-in" error message when trying to launch Adobe Illustrator, you can use the following: As an administrator

Microsoft's Windows 11 operating system may periodically display suggestions as pop-ups on your computer using the notification system. The suggestions system, originally intended to provide users with tips and suggestions for improving their Windows 11 workflows, has almost completely transformed into an advertising system to promote Microsoft services and products. Suggestion pop-ups might advertise a Microsoft 365 subscription to users, suggest linking an Android phone to the device, or set up a backup solution. If these pop-ups annoy you, you can tweak your system to disable them entirely. The following guide provides recommendations on disabling pop-ups on devices running Microsoft’s Windows 11 operating system.

Subtitles not working on Stremio on your Windows PC? Some Stremio users reported that subtitles were not displayed in the videos. Many users reported encountering an error message that said "Error loading subtitles." Here is the full error message that appears with this error: An error occurred while loading subtitles Failed to load subtitles: This could be a problem with the plugin you are using or your network. As the error message says, it could be your internet connection that is causing the error. So please check your network connection and make sure your internet is working properly. Apart from this, there could be other reasons behind this error, including conflicting subtitles add-on, unsupported subtitles for specific video content, and outdated Stremio app. like

Page refresh is very common in our daily network use. When we visit a web page, we sometimes encounter some problems, such as the web page not loading or displaying abnormally, etc. At this time, we usually choose to refresh the page to solve the problem, so how to refresh the page quickly? Let’s discuss the shortcut keys for page refresh. The page refresh shortcut key is a method to quickly refresh the current web page through keyboard operations. In different operating systems and browsers, the shortcut keys for page refresh may be different. Below we use the common W

Standby is a new feature in the iOS 17 update that provides a new and enhanced way to access information when your phone is idle quickly. With StandBy, you can conveniently check the time, view upcoming events, browse your calendar, get weather updates for your location, and more. Once activated, the iPhone will intuitively enter standby mode when set to landscape while charging. This feature is perfect for wireless charging points like your bedside table, or when you're away from your iPhone charging during daily tasks. It allows you to swipe through various widgets displayed in standby to access different sets of information from various applications. However, you may want to modify these widgets or even delete some based on your preferences and the information you need frequently. So let's dive into

What happens when the desktop layout is locked? When using the computer, sometimes we may encounter the situation where the desktop layout is locked. This problem means that we cannot freely adjust the position of desktop icons or change the desktop background. So, what exactly is going on when it says that the desktop layout is locked? 1. Understand the desktop layout and locking functions. First, we need to understand the two concepts of desktop layout and desktop locking. Desktop layout refers to the arrangement of various elements on the desktop, including shortcuts, folders, widgets, etc. we can be free
