我在網上發現了這種脈沖效果,它作業正常,但它設定為只在懸停時作業。我希望它是一個恒定的效果,不知道如何調整它以消除懸停要求。jquery 中的回呼總是讓我在閱讀代碼時有點不知所措。我正在學習..一次一點點。任何幫助都會很棒。
$(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() });
uj5u.com熱心網友回復:
當然你可以這樣做:
$('.pulse_image').pulse();
演示:http: //jsfiddle.net/bC7pS/
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/531317.html
標籤:jQuery脉冲
下一篇:jQuery脈動效果
