jquery generates fake load animation effects _jquery

Source: Internet
Author: User
Tags pdfobject blank page

In the use of pdfobject.js, because the background needs to convert data, in the foreground display, there is a long time to display a blank page, so think of writing a fake load animation

Script fragment:

<script type= "Text/javascript" >
var bar = 0; 
var line = "| |"; 
var amount = "| |"; 
function count () { 
bar= bar+2; 
Amount =amount + line; 
$ ("#chart"). val (amount);
$ ("#percent"). Val (bar+ "%"); 
if (bar<99) {
//Set 1.5 second cycle time
settimeout ("Count ()",);
} else{
$ ("#beforeSee"). Hide ();
$ ("#pdfSee"). Show ();
};
Window.onload = function () {
pdfobject.embed ("Request? Code=${vdata.code}", "#pdfSee");
Count (); 
}; 
</script>

Body Fragment:

<body >
<div align=center id= "Beforesee" width= "100%" height= "100%" > 
<p><span class= " Red "style=" font-size:50px; > Desperately load, please later </span></p> 
<p> 
<input type= "text" id= "chart" name= "chart" size= "46" Style= "font-family:arial; Font-weight:bolder; Color:gray;background-color:white; padding:0px; Border-style:none; " > 
<br> 
<input type= "text" id= "percent name=" percent "size=46 style=" font-family:arial; color: Gray Text-align:center; Border-width:medium; Border-style:none; " >
<script type= "Text/javascript" >
</script>
</p> 
</div>
< Div align=center id= "pdfsee" style= "Display:none" width= "100%" height= "100%" >
<p><span class= "Red" Style= "font-size:50px;" > control is missing, please reload </span></p>
</div>
</body>

The above is a small series to introduce the jquery generated fake load animation effect, I hope to help you, if you have any questions please give me a message, small set will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.