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!