有效的网页显示在WebKit浏览器和IE中,但不显示在Firefox中

Valid webpage displays in WebKit browsers and IE but not Firefox

本文关键字:显示 Firefox IE 浏览器 网页 WebKit 有效      更新时间:2023-09-26

我的网站在 http://derek.genevievehoward.com/不会显示在Firefox中,即使HTML和CSS是有效的。正文在 CSS 中display:none;,但我的脚本应该使用 Javascript 淡入正文。

当我查看Firefox中的开发人员工具时,它加载了所有脚本,CSS和HTML,但似乎没有发生淡入。我的猜测是,当页面加载时,Javascript不会自动执行,但我不知道为什么会这样。

尝试注释掉我的CSS链接,然后我的链接将使用jQuery加载到其他内容中。

你调用脚本.js两次,我建议将第一个从标题中取出。您还应该将 jquery 函数放在文档就绪函数中。

例如

$(document).ready(function() {
$(this).css("display", "block");
    //Fade in
    $("body").fadeIn(2000, function () {
        notify("My page is currently being changed. Expect brokenness.");
        $("article").fadeIn(1000);
    });
    //Link fades
    $("nav a").hover(function () {$(this).fadeTo(300,1)},function () {$(this).fadeTo(300,.3)});
    //notifications
    function notify(message) {
        document.getElementById("notifyText").innerHTML = message;
        $("#notification").fadeIn(500).fadeOut(4000);
    }
    //fade new content
    function fadeLoad(newUrl) {
        $("article").fadeOut(1000,function () { 
            $("article").load(newUrl, function () { 
                $("article").fadeIn(1000);
                });
        })
    }
    });