mirror of
https://github.com/AskDavis/Getting-Started-With-ACPI.git
synced 2026-01-01 05:05:57 -08:00
28 lines
584 B
JavaScript
28 lines
584 B
JavaScript
require([
|
|
'gitbook'
|
|
], function(gitbook) {
|
|
const options = {
|
|
margin: 0,
|
|
background: '#fff',
|
|
scrollOffset: 40
|
|
};
|
|
|
|
const init = function() {
|
|
mediumZoom("img", options);
|
|
}
|
|
|
|
gitbook.events.bind('start', function(e, config){
|
|
const configOption = config['medium-zoom'];
|
|
if (configOption) {
|
|
for (const item in options) {
|
|
if (options.hasOwnProperty(item) && (item in configOption)) {
|
|
options[item] = configOption[item];
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
gitbook.events.bind('page.change', function(e, config) {
|
|
init();
|
|
});
|
|
}); |