/
githubmirror
/
impress.js
Обзор
Документация
Войти
/
githubmirror
/
impress.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/plugins/resize/resize.js
33 строки
956 B
Henrik Ingo
Move helper functions from core to src/lib/util.js
05 окт 2017, 17:57
05 окт 2017, 17:57
f3d193d
Код
Авторство
О чём код?
/** * Resize plugin * * Rescale the presentation after a window resize. * * Copyright 2011-2012 Bartek Szopka (@bartaz) * Released under the MIT license. * ------------------------------------------------ * author: Bartek Szopka * version: 0.5.3 * url: http://bartaz.github.com/impress.js/ * source: http://github.com/bartaz/impress.js/ * */ /* global document, window */ ( function( document, window ) { "use strict"; // Wait for impress.js to be initialized document.addEventListener( "impress:init", function( event ) { var api = event.detail.api; // Rescale presentation when window is resized api.lib.gc.addEventListener( window, "resize", api.lib.util.throttle( function() { // Force going to active step again, to trigger rescaling api.goto( document.querySelector( ".step.active" ), 500 ); }, 250 ), false ); }, false ); } )( document, window );