jQuery的fadeIn()方法不工作? [英] jQuery fadeIn() method isn't working?

查看:85
本文介绍了jQuery的fadeIn()方法不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的HTML代码(我把重要的部分):

 < div id =aboutstyle = 显示:无; > 
< h2>关于我们< / h2>
< p>目标:教授和使用与创建游戏有关的技能。< / p>
< p>其中:CAT 145< / p>
< p>时间:星期一下午6:30 pm< p>
< / div>

这是我的JavaScript代码:

  window.onload = function(){
fadingIn();
};

函数fadingIn(){
// jQuery
$(function(){
$('#about')。fadeIn('slow'); / /淡入文本
});
}

当我执行完全相同的JavaScript代码(我复制并粘贴它)另一个页面工作正常,但由于某种原因,在这个页面上它不起作用。 -fadein-on-display-none>这里。
建议的行为是使用hide()而不是显示:none


Here is my HTML code (I put the important parts):

<div id = "about" style = "display:none;">
<h2>About Us</h2>
<p>Objective: To teach and use skills in relation to creating games.</p>
<p>Where: CAT 145</p>
<p>When: Monday's at 6:30pm</p>
</div>

Here is my JavaScript code:

window.onload = function() {
    fadingIn();
};

function fadingIn() {
    //jQuery
    $(function() {
        $('#about').fadeIn('slow'); //fades in the text
    });
}

When I do this exact same JavaScript code (I copy and pasted it) on another page it works fine, but for some reason on this page it doesn't work.

解决方案

You have an exact answer for this here.
Suggested behavior is using hide() and not display:none

这篇关于jQuery的fadeIn()方法不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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