Ok, this question is old, and link provided is dead, and some users provide nice correction on how to make usable answer, I decided to edit my answer explaining the process behind preloading instead providing just a link.
Preloading webpage is simply displaying some text, image or something else while the page is rendering, to notify the visitors that something is happening in the background. Easiest way is to include jQuery which simplify the whole process. Our main goal is to display, let say text, while page is loading. So, our task is displaying text first, then when the page is fully loaded, hide text and display content.
<script src="http://code.jquery.com/jquery-latest.min.js"></script> // include jQuery source
<script>
$('.content').hide(); // hide content while rendering
$(document).ready(function(){ // When page is fully loaded...
$('.preload').hide(); // hide preloader
$('.content').show(); // and show content
});
<div class="preload">Loading...</div>
<div class="content">Some generic content here</div>
This is just basic example, and you can play with jQuery to make some nice preloaders.
ORIGINAL
This is my first preloader. It's very simple. While page is loading, it shows preloader, and then hide preloader and show page. Preload web site using jquery (simple)
发布评论
评论(4)
右键单击源代码可能会有所帮助
这里是源代码,您可以在其中找到它的 jQuery。
http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/
A Right Click for Source code can be helpful
Here is the source where you can find the jQuery for it.
http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/
您可以在加载时替换或隐藏正文并显示页面加载,完成后显示内容,
这里有一篇关于此的旧文章:
如何使用 jQuery 创建“请稍候,正在加载...”动画?
应该是你想要的
脚本的 html 文件吗?认为它只能与 .js 一起使用
,你必须使用它在每个页面上添加它
you could replace or hide the body while it is loading and showing that the page loads and when its done the content is displayed
there was an older post here about this:
How can I create a "Please Wait, Loading..." animation using jQuery?
should be that what you want
an html file for script ? think its just working with .js
well you have to add it on every page using
标题
正文
Div
CSS
从 JavaScript(网站)网页预加载器 插入
Header
Body
Div
CSS
Inserted from JavaScript (website) Web page preloader
编辑
好吧,这个问题很旧,提供的链接已死,一些用户对如何做出可用的答案提供了很好的纠正,我决定编辑我的答案,解释预加载背后的过程,而不是只提供一个链接。
预加载网页只是在页面渲染时显示一些文本、图像或其他内容,以通知访问者后台正在发生某些事情。最简单的方法是包含 jQuery,它简化了整个过程。我们的主要目标是在页面加载时显示文本。因此,我们的任务是首先显示文本,然后当页面完全加载时,隐藏文本并显示内容。
这只是基本示例,您可以使用 jQuery 来制作一些不错的预加载器。
原创
这是我的第一个预加载器。这很简单。页面加载时,显示预加载器,然后隐藏预加载器并显示页面。
使用 jquery 预加载网站(简单)
EDIT
Ok, this question is old, and link provided is dead, and some users provide nice correction on how to make usable answer, I decided to edit my answer explaining the process behind preloading instead providing just a link.
Preloading webpage is simply displaying some text, image or something else while the page is rendering, to notify the visitors that something is happening in the background. Easiest way is to include jQuery which simplify the whole process. Our main goal is to display, let say text, while page is loading. So, our task is displaying text first, then when the page is fully loaded, hide text and display content.
This is just basic example, and you can play with jQuery to make some nice preloaders.
ORIGINAL
This is my first preloader. It's very simple. While page is loading, it shows preloader, and then hide preloader and show page.
Preload web site using jquery (simple)