HTML元素不会使用jquery淡入 [英] HTML element does not fade in using jquery

查看:54
本文介绍了HTML元素不会使用jquery淡入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小型Web项目,您可以在这里看到: http://seegermattijs.be/pickone/ 当您插入两个项目时,选择一个"按钮应淡入.遗憾的是它不会消失.我使用以下代码:

I have a small web project as you can see here: http://seegermattijs.be/pickone/ When you insert two items, the pick one button should fade in. Unfortunately it does not fade. I use the following code:

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

在开始时,我使.bigBtn不可见:

and in the begininning I make .bigBtn invisible:

$('.bigBtn').hide()

我在做什么错了?

推荐答案

已应用于页面上每个元素的CSS过渡(css/main.css的最开始):

The CSS transitions that you have applied to every element on the page (very beginning of your css/main.css):

* {
    transition: all .1s linear;
    -webkit-transition: all .1s linear;
    -moz-transition: all .1s linear;
    -o-transition: all .1s linear;
}

与jQuery淡入淡出动画发生冲突.

are clashing with the jQuery fade animation.

使用类似以下的方法从按钮中删除CSS过渡:

Remove the CSS transitions from your button using something like:

.bigBtn {
    transition: none;
    -webkit-transition: none;
    -moz-transition: none;
    -o-transition: none;
}

(或者更好的是,仅将它们应用于您想要的位置).

(Or better still, only apply them where you want them in the first place).

您的.fadeIn('slow')将正常工作.

这篇关于HTML元素不会使用jquery淡入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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