2016-07-22 5 views
0

fotorama js 슬라이더에서 전체 화면 팝업을 취소 한 후 첫 번째 이미지를 설정하는 방법.fotorama js에서 전체 화면 팝업을 종료 한 후 첫 번째 이미지를 설정하는 방법은 무엇입니까?

기본적으로 전체 화면을 취소하면 팝업의 마지막 활성 이미지가 슬라이더의 기본 이미지로 표시됩니다.

fotorama js에서 팝업을 취소 한 후 슬라이더의 첫 번째 이미지를 가져 오시겠습니까?

데모 링크 : http://fotorama.io/customize/fullscreen/ 이 fotoram JS

어떤 도움의 데모 링크 apericiated 것입니다.

감사합니다.

답변

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(); 
      }); 
      }