2014-10-12 2 views
2

smoothstate.js 라이브러리 내의 장면 요소의 역 애니메이션에 약간의 문제가 있습니다. 내가 사이트 작업입니다 : 실제로 LINKsmoothstate.js reverse animation

은 "됐나-종료"클래스는 DOM에 적용하지만 애니메이션이 여기 를 발생하지 않는 내 CSS입니다 :

.animated .scene_element{ 
    -webkit-animation-duration: 1s; 
      animation-duration: 1s; 
    -webkit-animation-fill-mode: both; 
      animation-fill-mode: both; 

} 

.animated.is-exiting .scene_element { 
      -webkit-animation-direction: alternate-reverse; 
      animation-direction: alternate-reverse; 
} 

및 JQuery와

;(function ($) { 
    'use strict'; 
    var $body = $('html, body'), // Define jQuery collection 
     content = $('#wrapper').smoothState({ 
     onStart : { 
      duration: 500, 
      render: function() { 
      content.toggleAnimationClass('is-exiting'); 

      // Scroll user to the top 
      $body.animate({ 'scrollTop': 0 }); 

      } 
     } 
     }).data('smoothState'); 
})(jQuery); 
+0

1 초는 정확히 예상, 원하는 결과 무엇인지 더 구체적으로 할 수 있습니까? –

+0

@isim 그는 현재 존재하지 않는 애니메이션 작품을 원한다는 것이 확실합니다. –

+0

@niecore, html을 공유하여 공유 할 수 있도록하십시오. 동일한 문제가 있습니다. toggleAnimationClass는 이미 사용되지 않습니다. 나는 아직도 그것을 알아 내지 않고있다. –

답변

1

css로 선언 된 애니메이션 기간은 javascript에 선언 된 전체 애니메이션보다 길다. 0.5 초

.animated .scene_element{ 
    -webkit-animation-duration: 1s; 
      animation-duration: 1s; 
onStart : { 
      duration: 500, 
      render: function() {