我需要些帮助。因此,这个页面使用的是iframe,因此累积布局转移是相当明显的。所以我们想要使用预加载器,这样你就看不到了。但是预加载程序代码只显示了大约100 for的预加载程序。我想改变这一点,所以我在脚本标记之间添加了这段代码。但现在预装载机一点也不走了。永远不停地旋转
这是代码:
jQuery(document).ready(function($) {
$(window).load(function() {
setTimeout(function() {
$('#preloader').fadeOut('slow', function() {});
}, 200); // set the time here
});
});.loader {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url('https://example.com/example.svg') 50% 50% no-repeat #aa9767;
/* Change the #fff here to your background color of choice for the preloader fullscreen section */
}
.elementor-editor-active .loader {
display: none;
}<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<div class="loader"></div>
发布于 2022-01-05 13:46:17
有两件事似乎不对:
.loader
document.ready中的函数参数不接受参数jQuery(文档).ready(函数(){$(窗口).load(函数(){setTimeout(函数(‘.loader’).fadeOut(‘.loader’).fadeOut(‘.loader’);},200);//设置这里的时间}};});
https://stackoverflow.com/questions/70592472
复制相似问题