2013-10-03 50 views
1

我有一個簡單的圖像滑動通過懸停多個圖像的循環。問題在於它非常波濤洶涌。原因在於,這是一個靜態圖像,在懸停狀態之前可見並隱藏於懸停狀態。這會使圖像週期不穩定。我只是想找一種方法來平滑週期。順利jQuery幻燈片

或者我只需要找到靜態圖像在懸停時消失的方法,並在鼠標離開div /圖像時重新出現。

我有以下

JS Fiddle Demo

jQuery代碼演示

jQuery(function($){ 

// Cycle plugin 
$('.slides').cycle({ 
    fx:  'none', 
    speed: 1000, 
    timeout: 70 
}).cycle("pause"); 

// Pause & play on hover 
$('.slideshow-block').hover(function(){ 
    $(this).find('.slides').addClass('active').cycle('resume'); 
}, function(){ 
    $(this).find('.slides').removeClass('active').cycle('pause'); 
}); 

}); 

靜態圖像上線#20在CSS

回答

1

那麼做,你說什麼,隱藏圖像時懸停,然後再次顯示圖像後似乎解決了問題。

jQuery(function($){ 

// Cycle plugin 
$('.slides').cycle({ 
    fx:  'none', 
    speed: 1000, 
    timeout: 70 
}).cycle("pause"); 

// Pause & play on hover 
    $('.slideshow-block').hover(function(){ 
     $(this).find('.link').hide(); 
    $(this).find('.slides').addClass('active').cycle('resume'); 
    }, function(){ 
     $(this).find('.link').show(); 
     $(this).find('.slides').removeClass('active').cycle('pause'); 
    }); 

}); 

http://jsfiddle.net/WCTX8/2/