บทความนี้อธิบายถึงวิธีการเริ่มต้นแถบความคืบหน้าการโหลดด้วยหน้าต่างเลียนแบบ JS แบ่งปันสำหรับการอ้างอิงของคุณ วิธีการใช้งานเฉพาะมีดังนี้:
คัดลอกรหัสดังนี้: <html>
<title> js เลียนแบบแถบความคืบหน้าการโหลดสำหรับ Windows Startup </title>
</head>
<body style = "margin: 0; พื้นหลังสี:#5279ce;" Scroll = ไม่>
<table id = lw style = "display: block; ตำแหน่ง: Absolute; top: 0; left: 0; z-index: 1; ความสูง:; width:" cellpacing = "0" cellpadding = "0">
<tr>
<td bgcolor = "#5279ce" align = "center"> <font face = "wingdings" style = "ตัวอักษรขนาด: 240px; color =#000000"> y </td>
</tr>
<tr>
<td bgColor = "#3F5FB2">
<ภาษาสคริปต์ = jscript>
elt = "0123456789abcdef";
var stbhtmls = "";
var stbhtmle = "";
สำหรับ (var i = 0; i <0xff-0x99; i+= 1)
-
var cr = "";
var l;
var stbhtml = "";
l = i+0x99;
สำหรับ (var j = 0; j <2; j ++)
-
var n = l % 16;
l = l >> 4;
cr = elt.charat (n)+cr;
-
l = i+0x33;
สำหรับ (var j = 0; j <2; j ++)
-
var n = l % 16;
l = l >> 4;
cr = elt.charat (n)+cr;
-
l = i;
สำหรับ (var j = 0; j <2; j ++)
-
var n = l % 16;
l = l >> 4;
cr = elt.charat (n)+cr;
-
var w = i> (0xff-0xa0)? 8: 4
stbhtml = "<span style = 'ความสูง: 10; ความกว้าง:"+w+"; พื้นหลัง-สี:#"+cr+"; มาร์จิ้น: 0; padding: 0'> </span>"
stbhtmls+= stbhtml;
stbhtmle = stbhtml+stbhtmle;
-
var stbhtml = stbhtmls+stbhtmle;
document.write ("<marqueee id = 'โหลด' scrolllamount = '30 'ทิศทาง =' ขวา 'scrolldelay =' 1 'ความสูง =' 4 'style =' ความกว้าง: 100%; ความสูง: 10; ตัวอักษรขนาด: 6px; พื้นหลังสี:#003399 '>"
document.write (stbhtml)
document.write ("</marquee>")
</script> </td>
</tr>
<tr>
<td bgcolor = "#ecf0ff"> <center> <span id = load_txt style = "ตัวอักษรขนาด: 12px;"> <b id = showtxt style = "สี: สีแดง; ตัวอักษรขนาด: 12px; จุดสูง: 138%;
<p allign = "center" style = "font-size: 9pt;"> Copyright@</p> </td>
</tr>
</table>
<ภาษาสคริปต์ = "JavaScript">
-
var findError = false;
ฟังก์ชั่นประตู ()
-
if (document.readystate == "เสร็จสมบูรณ์")
-
showtxt.innerhtml = "กำลังโหลดโปรดรอ ... "
loading.style.display = "ไม่มี";
-
-
-
</script>
</body>
</html>
ฉันหวังว่าบทความนี้จะเป็นประโยชน์กับการเขียนโปรแกรม JavaScript ของทุกคน