I have a bunch of thumbnails which I am loading with a style of visibility: hidden; so that they all maintain their correct layouts. Once the page is fully loaded I have a jquery function that fades them in. This worked when their style was set to display: none; but obviously the layout screwed up then. Any suggestions?

Heres the fade line:

$('.littleme').fadeIn('slow');

推荐答案

Add a few calls to the chain like this:

 $('.littleme').css('visibility','visible').hide().fadeIn('slow');

This will change it to display:none for 1 frame before fading in, occupying the area again.

Jquery相关问答推荐

Visual Studio - 将文本粘贴到 cshtml 中会删除文本

$.post 和 $.ajax 之间的区别?

ASP .NET MVC 在每个字段级别禁用客户端验证

使用 D3.js(IE、safari 和 chrome)创建 SVG 后,如何保存/导出 SVG 文件?

禁用表单提交上的提交按钮

复选框值始终为打开

未捕获的 TypeError:data.push 不是函数

使用 JQuery 激活 bootstrap 选项卡

按文本 Select 链接(完全匹配)

Bootstrap 4 文件输入

javascript过滤对象数组

使用javascript将HTML页面中的div下载为pdf

获取jQuery中下拉列表的值

默认情况下如何将tinymce粘贴为纯文本

删除所有以某个字符串开头的类

bootstrap 日期和时间 Select 器

$(document).click() 在 iPhone 上无法正常工作. jQuery

如何在 jQuery 中取消绑定悬停?

如何让 jQuery 等到效果完成?

jQuery:通过 .attr() 添加两个属性;方法