简体   繁体   English

jQuery Fadein和Fadeout在本地主机上工作正常,但在Web服务器上工作不正常

[英]jquery fadein and fadeout works fine on localhost but not on web server

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>

jquery is in header section. jQuery在标题部分。 The script below is right at the end in the body section. 下面的脚本就在正文部分的末尾。

The fadeIn and fadeOut functions are for thumbnails with buttons to trigger the event are part of the thumbnail divs. 淡入和淡出功能适用于缩略图,其中带有触发事件的按钮是缩略图div的一部分。 That is the reason for fade and fade2 ids. 这就是衰落和fade2 id的原因。

$('#fade').click(function() {
                  $('#t1').css('visibility','hidden').hide().fadeOut('slow', function(){
                  $('#t11').css('visibility','visible').hide().fadeIn();
                  });

                });
          $('#fade2').click(function() {
                  $('#t11').css('visibility','hidden').hide().fadeOut('slow', function() {
                  $('#t1').css('visibility','visible').hide().fadeIn();
                  });

                });

PROBLEM: This works perfectly on localhost but when I upload the files on dreamhost, this particular function doesn't work. 问题:这在localhost上可以正常使用,但是当我在dreamhost上上传文件时,此特定功能不起作用。 I have other jQuery functions that work fine. 我还有其他可以正常工作的jQuery函数。 I debugged using firebug, and see no loading errors or any other errors. 我使用Firebug进行了调试,没有看到加载错误或其他任何错误。

What am I missing here? 我在这里想念什么?

Thanks 谢谢

D d

Try something like this. 尝试这样的事情。

$('#fade').click(function() {
    $('#t1').fadeOut('slow', function(){ //First do the animation of FadeOut
        $('#t11').fadeIn(); // when done, fadeIn the other element
    });

});
$('#fade2').click(function() { //Backwards
    $('#t11').fadeOut('slow', function() {
        $('#t1').fadeIn();
    });

});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM