jQuery Fade in Site/Content Once It#39;s Loaded?(加载后,jQuery 淡入网站/内容?)
问题描述
是否有任何教程或插件可以在网站正确加载后将其淡入视野,以限制任何不和谐等,从而使内容基本流畅?
Are there any tutorials or plugins for fading a site into view once its loaded properly, to limit any jarring etc, so the content appears smoothly basically?
我想如果它只是一个特定区域会更容易,因为页眉或页脚已经被缓存,从以前的页面......
I suppose it would be easier if it was just a specific area, as a header or footer will already be cached, from previous pages...
例如带有各种缩略图的投资组合页面,它们只有在准备好后才会流畅显示.
For example a portfolio page with various thumbnails, they only appear smoothly when ready.
这个可以吗?
感谢您的帮助:)
推荐答案
是的,用 div 包装你的内容(例如 <div id="main-content">
)并在你的css 把这个:
Yes, wrap your content with a div (e.g. <div id="main-content">
) and in your css put this:
div#main-content { display: none; }
然后使用这个脚本.
$(document).ready(function() {
$('#main-content').fadeIn();
});
这篇关于加载后,jQuery 淡入网站/内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:加载后,jQuery 淡入网站/内容?


基础教程推荐
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01