2016-07-22 13 views
0

fotorama jsスライダの中でキャンセルする全画面ポップアップの後に最初の画像を設定する方法。fotorama jsで全画面表示を終了した後に最初の画像を設定する方法は?

デフォルトでは、フルスクリーンのキャンセル後に、ポップアップ内の最後のアクティブな画像がスライダのメイン画像として表示されます。

fotorama jsのキャンセルポップアップの後にスライダの最初のイメージを取得したいですか?

デモへのリンク:http://fotorama.io/customize/fullscreen/ これは、任意の助けがapericiatedされるだろう

JS fotoramのデモリンクです。

ありがとうございました。

答えて

0

我々はself.settings.api.first()

 /** 
      * Gallery fullscreen settings. 
      */ 
      initFullscreenSettings: function() { 
       var settings = this.settings, 
        self = this; 
settings.$gallery = this.settings.$element.find('[data-gallery-role="gallery"]'); 
settings.$gallery.on('fotorama:fullscreenexit', function() { 
       settings.closeIcon.hide(); 
       settings.focusableStart.attr('tabindex', '-1'); 
       settings.focusableEnd.attr('tabindex', '-1'); 
       settings.api.updateOptions(settings.defaultConfig.options, true); 
       settings.focusableStart.unbind('focusin', this._focusSwitcher); 
       settings.focusableEnd.unbind('focusin', this._focusSwitcher); 
       settings.closeIcon.hide(); 

       if (!_.isEqual(settings.activeBreakpoint, {}) && settings.breakpoints) { 
        settings.api.updateOptions(settings.activeBreakpoint.options, true); 
       } 
       settings.isFullscreen = false; 
       settings.$element.data('gallery').updateOptions({ 
        swipe: true 
       }); 

       self.settings.api.first(); 
      }); 
      } 
を使用してそれを行うことができます
関連する問題