2013-02-28 29 views
0

这里是一个工作的jsfiddle:的Javascript/jQuery的动画完成后,显示结束的div

http://jsfiddle.net/YnT2X/

我不想在div显示后,才返回动画完成。

的jQuery:

$(document).ready(function() { 
    $("#menu").hover(function() { 
     $('#arrow').hide(); 
     $("body").children(':not(#menu)').css("-webkit-filter", "blur(2px)"); 
     $(this, '#arrow').stop().animate({ 
      width: "200px" 
     }, 250, 

     function() { 
      if ($('#menu').width() == '200') { 
       $('.text').fadeIn(200); 
      } 
     }); 
    }, function() { 
     $(this).stop().animate({ 
      width: "0px" 
     }, 250) 
     $("body").children(':not(#menu)').css("-webkit-filter", "none"); 
     $('.text').fadeOut('fast'); 
     $('#arrow').show(); 
    }); 
    }); 
+0

不知道你的意思,但是这是它 - > [** ** FIDDLE(HTTP:// jsfiddle.net/adeneo/YnT2X/1/)?? – adeneo 2013-02-28 22:47:22

回答

2

试试这个: 小提琴:http://jsfiddle.net/upycZ/

$(document).ready(function() { 
    $("#menu").hover(function() { 
     $('#arrow').hide(); 
     $("body").children(':not(#menu)').css("-webkit-filter", "blur(2px)"); 
     $(this, '#arrow').stop().animate({ 
      width: "200px" 
     }, 250, 

     function() { 
      if ($('#menu').width() == '200') { 
       $('.text').fadeIn(200); 
      } 
     }); 
    }, function() { 
     $(this).stop().animate({ 
      width: "0px" 
     }, 250,function(){ 
     $('#arrow').show(); //<- Shows arrow after run 
     }); 
     $("body").children(':not(#menu)').css("-webkit-filter", "none"); 
     $('.text').fadeOut('fast'); 

    }); 
}); 
+0

谢谢!那正是我需要的! – 2013-02-28 22:50:35

+0

没问题:)。如果您发现此功能有用,您可以通过勾选此帖子左侧的复选标记将其标记为答案。 – 2013-02-28 22:58:57