我正在使用Laravel。头和页脚标记在我的app.blade file.But中,它第一次打开时不会在Head标记中运行预加载程序。它也不加载css文件。它是在1-2秒之后出现的。太快了,拍不出截图,所以我把它作为视频上传。我将添加与视频下面的代码行。
app.blade.php头码:
@if(!isset($lang)) @php($lang = 'tr') @endif
@php($slug = Request::segment(1))
<!DOCTYPE html>
<html lang="tr">
<head>
<title>NovaPia Clinic</title>
<meta charset="UTF-8">
<meta name="description" content="NovaPia Clinic">
<meta name="keywords" content="Dentist, Clinic">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Stylesheets -->
<link rel="stylesheet" href="{{ asset('theme/css/style.css')}}"/>
<link rel="stylesheet" href="{{ asset('theme/css/responsive.css')}}"/>
<link rel="stylesheet" href="{{ asset('theme/css/animate.css')}}"/>
<link rel="shortcut icon" href="{{ asset('theme/img/favico.png')}}">
<link rel="stylesheet" href="{{ asset('theme/icon-fonts/fontawesome-5.0.6/css/fontawesome-all.min.css')}}"/>
<link rel="stylesheet" href="{{ asset('theme/icon-fonts/flaticon/flaticon.css')}}"/>
<link rel="stylesheet" href="{{ asset('theme/icon-fonts/flaticon/flaticon.svg')}}"/>
<link rel="stylesheet" href="{{ asset('theme/icon-fonts/flaticon/flaticon.ttf')}}"/>
<script src="https://kit.fontawesome.com/40e15e0d0d.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="{{ asset('theme/font/stylesheet.css')}}"/>
</head>
<body>
<div id="preloader">
<div class="loading-area">
<div class="logo" style=""><img src="{{ asset('theme/img/nova.png')}}" alt=""></div>
<span>yükleniyor...</span>
</div>
<div class="left-side"></div>
<div class="right-side"></div>
</div>
<div class="page-overlay">
<div class="page-transition"></div>
</div>
<main>
<header class="whitev">
<a href="index.html" class="logo" data-type="ajax-load">
<img src="{{ asset('img/nova.svg')}}" alt="">
</a>
<div class="nav-icon">
<span></span>
<span></span>
<span></span>
</div>
</header>```发布于 2022-06-28 08:48:34
您必须在正文中添加display:none,并添加setTimeout以将显示值更改为5秒后阻塞,例如:
<body style="display:none" id="body_id">
<script>setTimeout(() => { document.getElementById('body_id').style.display = 'block'; }, "5000");</script>https://stackoverflow.com/questions/72783126
复制相似问题