2013-01-16 2 views
0
$("a.details") 
    .click(function() { 
    var $this = $(this); 

    $this.parents(".subscription") 
     .find('.plan-details') 
     .stop(true, true) 
     .animate({ 
     height: ['toggle', 'easeOutBounce'] 
    }, 'slow', 

    function() { 
     $this.text(function (i, text) { 
      return text == 'View Details' ? 'Hide Details' : 'View Details';); 
     }) , 

     function (e) { 
      $this.parents(".subscription") 
       .find('.plan-details') 
       .stop(true, true) 
       .animate({ 
       height: 'toggle' 
      }); 

     }); 

가 바이올린 반송 : http://jsfiddle.net/6fCrd/슬라이드

... 내가 잘못 여기서 뭐하는 거지 확실하지, 그것은 작동하지 않습니다. 바운스 (bounce) 효과와 함께 아래로 내려야하고 트리거 텍스트도 변경해야합니다. 여기에 구문 오류가있을

+0

은 어쩌면 [바이올린] 추가 (http://jsfiddle.net) 그래서 우리는 그것을 볼 수 있습니다 –

+0

아 죄송합니다, 지금은 – 3zzy

답변

1

:

return text == 'View Details' ? 'Hide Details' : 'View Details';); 
// ... and here 
$this.text(function (i, text) { 
     return text == 'View Details' ? 'Hide Details' : 'View Details'; 
}, function (e) { 

편집

당신은 애니메이션 효과에 대한 JQuery와 UI를 포함해야

내 데모를보십시오 : http://jsfiddle.net/6fCrd/7/

+0

추가 1) 전혀 효과가 없습니다. 즉각적으로 보여줍니다. 2) 표시된 후에는 숨기지 않습니다. – 3zzy

+0

jquery UI가 포함되어 있지 않기 때문입니다. 답변을 업데이트했습니다. – phnkha

관련 문제