var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 document.onreadystatechange = function() { var state = document.readyState; switch (state) { case 'loading': console.log('正在加载...'); break; case 'interactive': //文档已经完成加载,文档已被解析,但是资源仍在加载。 //console.log('正在交互...'); break; case 'complete': document.body.removeAttribute('style'); var $loading = document.getElementsByClassName('loading')[0]; setTimeout(function() { $loading.classList.add('animated', 'fadeOut'); setTimeout(function() { $loading.parentNode.removeChild($loading); }, 1000); swiper.slideTo(0, 0); }, 1000); break; default: break; } if (isAndroid == false) { $('#mp3').removeClass('rotate-360') } }