加载后,jQuery 淡入网站/内容? [英] jQuery Fade in Site/Content Once It's Loaded?

查看:20
本文介绍了加载后,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 淡入网站/内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆