Difference between revisions of "Template:SJTU-Software/loadingJs"
Ricky chen (Talk | contribs) (Created page with "$(document).ready(function(){ var loading = setInterval(progressBarUpdate, 1000) $(".content").load("welcome.html", function(){ $(".progressBar").css("width", "100%") se...") |
Gougoumemeda (Talk | contribs) |
||
Line 1: | Line 1: | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
var loading = setInterval(progressBarUpdate, 1000) | var loading = setInterval(progressBarUpdate, 1000) | ||
− | $(".content").load("welcome.html", function(){ | + | $(".content").load("Team:SJTU-Software/welcome.html", function(){ |
$(".progressBar").css("width", "100%") | $(".progressBar").css("width", "100%") | ||
setTimeout(function(){ | setTimeout(function(){ |
Revision as of 19:08, 18 September 2015
$(document).ready(function(){ var loading = setInterval(progressBarUpdate, 1000) $(".content").load("Team:SJTU-Software/welcome.html", function(){ $(".progressBar").css("width", "100%") setTimeout(function(){ $(".loading").fadeOut(500, function(){ $(".loading").remove() $(".content").css("display", "inline") }) },1000) clearInterval(loading) }) })
var progressBarUpdate = function(){ var currentWidth = $(".progressBar").css("width") var width = parseInt(currentWidth.substring(0, currentWidth.length - 2)) if (width <= $(window).width() * 0.9){ width += 100; $(".progressBar").css("width", width.toString() + "px") } }