Line 1: | Line 1: | ||
− | |||
var _LoadingHtml = '<div id="loadingDiv" style="position:absolute;left:0;top:0;width:calc(100%);height:100%;background-color: #E6E6E6;z-index: 9999999999999;margin:0;padding:0;"><img style="position: absolute;top: calc(50% - 90px);left:calc(50% - 86px);height: 180px;width: 172px;z-index:99999999999991;" src="https://static.igem.org/mediawiki/2018/0/0b/T--BIT-China--iGEM2018-A_loading.gif"></div>'; | var _LoadingHtml = '<div id="loadingDiv" style="position:absolute;left:0;top:0;width:calc(100%);height:100%;background-color: #E6E6E6;z-index: 9999999999999;margin:0;padding:0;"><img style="position: absolute;top: calc(50% - 90px);left:calc(50% - 86px);height: 180px;width: 172px;z-index:99999999999991;" src="https://static.igem.org/mediawiki/2018/0/0b/T--BIT-China--iGEM2018-A_loading.gif"></div>'; | ||
− | |||
document.write(_LoadingHtml); | document.write(_LoadingHtml); | ||
− | |||
− | |||
document.onreadystatechange = completeLoading; | document.onreadystatechange = completeLoading; | ||
− | |||
− | |||
− | |||
function completeLoading() { | function completeLoading() { | ||
− | |||
− | |||
− | |||
− | |||
document.documentElement.style.overflow = 'hidden'; | document.documentElement.style.overflow = 'hidden'; | ||
if (document.readyState == "complete") { | if (document.readyState == "complete") { | ||
− | |||
window.onbeforeunload = function () { | window.onbeforeunload = function () { | ||
− | document.documentElement.scrollTop = 0; | + | document.documentElement.scrollTop = 0; |
− | document.body.scrollTop = 0; | + | document.body.scrollTop = 0; |
} | } | ||
− | |||
− | |||
− | |||
$(window).load(function () { | $(window).load(function () { | ||
$('#loading_all').delay(300).hide(0); | $('#loading_all').delay(300).hide(0); | ||
setTimeout(function () { | setTimeout(function () { | ||
$('body').removeClass("scoll_dis"); | $('body').removeClass("scoll_dis"); | ||
− | |||
}, 300); | }, 300); | ||
$.fn.fullpage.setAllowScrolling(false, 'down'); | $.fn.fullpage.setAllowScrolling(false, 'down'); | ||
}); | }); | ||
− | |||
setTimeout(function () { | setTimeout(function () { | ||
− | |||
− | |||
var loadingMask = document.getElementById('loadingDiv'); | var loadingMask = document.getElementById('loadingDiv'); | ||
loadingMask.classList.add('imgA-nav-gradient-back'); | loadingMask.classList.add('imgA-nav-gradient-back'); | ||
Line 42: | Line 23: | ||
setTimeout(function () { | setTimeout(function () { | ||
− | |||
var loadingMask = document.getElementById('loadingDiv'); | var loadingMask = document.getElementById('loadingDiv'); | ||
loadingMask.classList.remove('imgA-nav-gradient-back'); | loadingMask.classList.remove('imgA-nav-gradient-back'); | ||
loadingMask.parentNode.removeChild(loadingMask); | loadingMask.parentNode.removeChild(loadingMask); | ||
− | $.fn.fullpage.setAllowScrolling(true, 'down'); | + | $.fn.fullpage.setAllowScrolling(true, 'down'); |
− | + | ||
}, 4400); | }, 4400); | ||
} | } | ||
− | |||
function newFunction() { | function newFunction() { | ||
return false; | return false; | ||
} | } | ||
} | } |
Revision as of 11:19, 14 October 2018
var _LoadingHtml = '<img style="position: absolute;top: calc(50% - 90px);left:calc(50% - 86px);height: 180px;width: 172px;z-index:99999999999991;" src="">
';
document.write(_LoadingHtml); document.onreadystatechange = completeLoading; function completeLoading() {
document.documentElement.style.overflow = 'hidden'; if (document.readyState == "complete") { window.onbeforeunload = function () { document.documentElement.scrollTop = 0; document.body.scrollTop = 0; } $(window).load(function () { $('#loading_all').delay(300).hide(0); setTimeout(function () { $('body').removeClass("scoll_dis"); }, 300); $.fn.fullpage.setAllowScrolling(false, 'down'); }); setTimeout(function () { var loadingMask = document.getElementById('loadingDiv'); loadingMask.classList.add('imgA-nav-gradient-back'); document.documentElement.style.overflowY = 'auto'; }, 3000);
setTimeout(function () { var loadingMask = document.getElementById('loadingDiv'); loadingMask.classList.remove('imgA-nav-gradient-back'); loadingMask.parentNode.removeChild(loadingMask); $.fn.fullpage.setAllowScrolling(true, 'down'); }, 4400); } function newFunction() { return false; }
}