2012-08-14 1 views
0

이 펄스 효과는 온라인에서 발견되었으며 정상적으로 작동하지만 호버에서만 작동하도록 설정되었습니다. 호버 요구 사항을 제거하기 위해 그것을 조정하는 방법이 확실하지 않고 지속적인 효과를 원합니다. jquery의 콜백은 코드를 읽는 데있어 조금 벗어난다. 나는 배우고있다. 한 번에 조금씩. 어떤 도움이라도 좋을 것입니다.joverery 코드가 호버 둘레에서 계속 일정하게 변경되도록

$(function(){ 
$.extend($.fn.pulse = function(){ 
var minOpacity = .33; 
var fadeOutDuration = 400; 
var fadeInDuration = 400; 
$(this).attr('pulsing', 'y'); 

$(this).animate({ 
opacity: minOpacity 
}, fadeOutDuration, function() { 
$(this).animate({ 
opacity: 1 
}, fadeInDuration, function() { 
if($(this).attr('pulsing') == 'y') $(this).pulse(); 
}) 
}); 
return $(this); 
}); 
$.extend($.fn.stopPulse = function(){ 
$(this).attr('pulsing', '').stop(true,true).animate({opacity:1}); 
}); 

$('.pulse_image').(function(){ $(this).pulse() },function(){ $(this).stopPulse() }); 

답변

1

은 확실히 당신은 다만 할 수 있습니다

$('.pulse_image').pulse(); 

DEMO : http://jsfiddle.net/bC7pS/

+0

너무 감사합니다! 그런 간단한 변화. 나는 너희들 덕분에 배우고있다. – DC1