2011-11-02 71 views
0

的「標題」動畫的方式,我發現這個偉大的jQuery的幻燈片: http://slidesjs.com/examples/images-with-captions/更改此jQuery的圖像幻燈片

不過,我想它所以「標題」區域不會消失,並顯示各自圖片。如果只是根據新圖像更改文字,我更喜歡。

這是可能的,如果是這樣,我該如何做到這一點?

以供參考,在這裏是文件:slides.min.jquery.jshttp://slidesjs.com/examples/images-with-captions/js/slides.min.jquery.js

,這裏是正在使用的JavaScript代碼的一個片段:

animationStart: function(current){ 
        $('.caption').animate({ 
         bottom:-35 
        },100); 
        if (window.console && console.log) { 
         // example return of current slide number 
         console.log('animationStart on slide: ', current); 
        }; 
       }, 
       animationComplete: function(current){ 
        $('.caption').animate({ 
         bottom:0 
        },200); 
        if (window.console && console.log) { 
         // example return of current slide number 
         console.log('animationComplete on slide: ', current); 
        }; 
       }, 
       slidesLoaded: function() { 
        $('.caption').animate({ 
         bottom:0 
        },200); 
       } 

非常感謝任何指針。

+0

嘗試刪除第一個字幕 - 動畫部分? – OptimusCrime

回答

2
animationStart: function(current){ 
        if (window.console && console.log) { 
         // example return of current slide number 
         console.log('animationStart on slide: ', current); 
        }; 
       }, 
       animationComplete: function(current){ 
        $('.caption').animate({ 
         bottom:0 
        },200); 
        if (window.console && console.log) { 
         // example return of current slide number 
         console.log('animationComplete on slide: ', current); 
        }; 
       }, 
       slidesLoaded: function() { 
        $('.caption').animate({ 
         bottom:0 
        },200); 
       } 

從事示例頁面的工作。

|編輯|這裏有100%的工作示例:http://jsfiddle.net/byvd9/1/

1

我做了一個調整,使圖像在進入carreganda後以不透明度開始的不透明度消失 - 請記住,如果您選擇淡入淡出過渡效果,不透明度中的標題淡入淡出,但只能確保可以感知效果,或者如果您希望它更像atrazado來打開圖像。

<script> 
     $(function(){ 
      $('#slides').slides({ 
       preload: true, 
       //preloadImage: 'img/banner/carregando.gif', 
       play: 5000, 
       pause: 2500, 
       effect: 'fade', 
       fadeEasing: "easeOutQuad", 
       fadeSpeed: 850, 
       hoverPause: true, 
       animationStart: function(current){ 
        $('.caption').animate({ 
         bottom:0, 
         opacity:0 
        },100); 
        if (window.console && console.log) { 
         // example return of current slide number 
         console.log('animationStart on slide: ', current); 
        }; 
       }, 
       animationComplete: function(current){ 
        $('.caption').animate({ 
         bottom:0, 
         opacity:1 
        },600); 
        if (window.console && console.log) { 
         // example return of current slide number 
         console.log('animationComplete on slide: ', current); 
        }; 
       }, 
       slidesLoaded: function() { 
        $('.caption').animate({ 
         bottom:0, 
         opacity:1 
        },600); 
       } 
      }); 
     }); 
    </script>