0

我有一个事件日历,当您单击某一天时,它会加载每日程序。但它不会淡入。页面有三个 div,因为日历只显示实际月份、上个月和下个月。(div1 - prev, div2 - actual, div3 - next) 但一次只有一个可见。它完美地加载了内容,但没有淡入淡出。任何的想法?

谢谢!

丹尼尔

   $(document).ready(function(){
      $(".freeday").click(function(){
         $("#p_div1").load("none.txt", {}, function(){ $(this).fadeIn("700");}    );
         $("#p_div2").load("none.txt", {}, function(){ $(this).fadeIn("700");}    );
         $("#p_div3").load("none.txt", {}, function(){ $(this).fadeIn("700");}    );    
      });
   });
4

1 回答 1

0
$(document).ready(function(){
      $(".freeday").click(function(){
         $("#p_div1").hide().load("none.txt", {}, function(){ $(this).fadeIn("700");}    );
         $("#p_div2").hide().load("none.txt", {}, function(){ $(this).fadeIn("700");}    );
         $("#p_div3").hide().load("none.txt", {}, function(){ $(this).fadeIn("700");}    );    
      });
   });

.load()获取请求完成时执行的回调函数。为了成功.fadeIn()内容,您应该首先隐藏容器,加载内容,最后执行.fadeIn()函数。

于 2013-02-13T22:01:46.957 回答