想要使用jQuery淡入效果,但想要使用可见性:最初是隐藏的 [英] Want to use jquery fade in effects, but want to use visibility:hidden initially

查看:77
本文介绍了想要使用jQuery淡入效果,但想要使用可见性:最初是隐藏的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎大多数的jquery淡入/淡出和动画功能都是基于具有display:none而不是visible:hidden的初始元素.

It seems most of the jquery fadein/out and animate functions are based on the initial element having display:none as opposed to visibility:hidden.

如果我希望初始元素占用页面空间(即使用能见度:隐藏),然后使用淡入/淡出或滑动效果怎么办?有没有简单的方法可以做到这一点?

What if I want the initial element to take space up on the page (i.e. use visibility:hidden), but then use a fade in/out or slide effect? Is there an easy way to do this?

推荐答案

您也可以尝试类似的方法(演示)为fadeIn

You may also try something like this (Demo) as fadeIn

$('div').css({opacity: 0, visibility: "visible"}).animate({opacity: 1}, 'slow');

这篇关于想要使用jQuery淡入效果,但想要使用可见性:最初是隐藏的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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