2014-02-17 3 views
0

페이지로드시 자동으로 실행되는 Jquery 손잡이를 사용하고 있습니다. 이 함수에서 Waypoint 호출을 삽입 할 위치를 파악할 수 없습니다. 어떤 제안이라도 대단히 감사합니다.Waypoint로 Jquery 애니메이션 시작

  <script> 
       $(document)(function() { 
        $('.dial').knob({ 
         min: '0', 
         max: '100', 
         readOnly: true 
        }); 

        $('.dial').each(function(){ 
         $(this).animate({ 
          value: $(this).data('number') 
         },{ 
          duration: 950, 
          easing: 'swing', 
          progress: function() { 
           $(this).val(Math.round(this.value)).trigger('change'); 
          } // progress:function 
         }); // middle 
        }); //dial.each.function 
       }); // function 
       </script> 

답변

0

다음이 작동합니다.

$(document)(function() { 
    $('.thing').waypoint(function(direction) { // Change ".thing" to the div class containing your knobs // 
     $('.dial').knob({ 
      min: '0', 
      max: '100', 
      readOnly: true 
     }); 

    $('.dial').each(function(){ 
     $(this).animate({ 
     value: $(this).data('number') 
     },{ 
      duration: 950, 
      easing: 'swing', 
      progress: function() { 
      $(this).val(Math.round(this.value)).trigger('change'); 
      } // progress:function 
      }); // middle 
     }); //dial.each.function 
    }); 
}); // function