1

任何人都知道该javascript代码可能有什么问题吗?它已执行,但没有显示幻灯片动画

我正在使用 mootools 1.2.4

  • mootools-1.2.4-core.js
  • mootools-1.2.4.4-more.js

我的第一次尝试:

   window.addEvent('domready', function () {
        var mySlide = new Fx.Slide('errorBox');
        var ie = /MSIE (\d+\.\d+);/.test(navigator.userAgent);

        if ((ie && document.getElementById("errorBox").innerText == "") || !ie && document.getElementById("errorBox").textContent.trim() == "") {
            mySlide.hide();
        }
        else if (!ie && document.getElementById("errorBox").textContent.trim() == "") {
            mySlide.hide();
        } else {
            mySlide.slideIn();
        }
    });

添加延迟也无济于事,在页面被加载后,框会出现没有任何延迟或动画

    window.addEvent('domready', function () {
        var mySlide = new Fx.Slide('errorBox');
        var ie = /MSIE (\d+\.\d+);/.test(navigator.userAgent);

        if ((ie && document.getElementById("errorBox").innerText == "") || !ie && document.getElementById("errorBox").textContent.trim() == "") {
            mySlide.hide();
        }
        else if (!ie && document.getElementById("errorBox").textContent.trim() == "") {
            mySlide.hide();
        } else {
            mySlide.slideIn().chain(function () {
            // Waits one second, then the Element appears without transition.
                this.slideIn.delay(5000, this);
            });
        }
    });

谢谢

4

0 回答 0