2011-01-13 2 views
0

Galleriffic 함께 발생하는 애니메이션 작성을 중지하려면 stop() 함수를 사용하는 방법을 알아 내려고 해요. 엄지 손톱 이미지 위에 마우스를 신속하고 반복적으로 올리면 발생합니다. 간단한 jquery 스크립트에서 animate 함수와 함께 stop() 함수를 사용한다는 것을 알고 있지만, galleriffic은 많은 코드를 사용하므로 어디에서 어떻게 적용해야하는지 명확히 알 수 없습니다.Galleriffic 2.0 애니메이션 대기열 빌드

저는 jquery btw를 처음 사용합니다. jQuery 1.4.4 및 Galleriffic 2.0을 사용하여 Galleriffic 다운로드에 포함 된 예제 작업을 수행했습니다.

답변

1

좋아, 마침내 알아 냈어. 엄지 손톱 위로 마우스를 가져갈 때 투명도가 사라지는 것은 "jquery.opacityrollover.js"라는 스크립트로 처리됩니다.

투명도는 jquery "animate"기능으로 애니메이션되지 않지만 대신 "fadeTo"기능으로 애니메이션됩니다. 코드는 다음과 같습니다

/** 
* jQuery Opacity Rollover plugin 
* 
* Copyright (c) 2009 Trent Foley (http://trentacular.com) 
* Licensed under the MIT License: 
* http://www.opensource.org/licenses/mit-license.php 
*/ 
;(function($) { 
var defaults = { 
    mouseOutOpacity: 0.67, 
    mouseOverOpacity: 1.0, 
    fadeSpeed:   'fast', 
    exemptionSelector: '.selected' 
}; 

$.fn.opacityrollover = function(settings) { 
    // Initialize the effect 
    $.extend(this, defaults, settings); 

    var config = this; 

    function fadeTo(element, opacity) { 
     var $target = $(element); 

     if (config.exemptionSelector) 
      $target = $target.not(config.exemptionSelector);  

     $target.fadeTo(config.fadeSpeed, opacity); 
    } 

    this.css('opacity', this.mouseOutOpacity) 
     .hover(
      function() { 
       fadeTo(this, config.mouseOverOpacity); 
      }, 
      function() { 
       fadeTo(this, config.mouseOutOpacity); 
      }); 

    return this; 
}; 
})(jQuery); 

그래서 내가 재판을 통해 당신이해야 할 모든이 변경되어 테스트를 파악

$target.fadeTo(config.fadeSpeed, opacity); 

$target.stop().fadeTo(config.fadeSpeed, opacity);