webpack-bootstrap-ui-kit/src/js/_components/_ui.shrink.js

23 lines
350 B
JavaScript
Raw Normal View History

2019-06-08 17:20:51 +02:00
"use strict";
import $ from 'jquery';
const ShrinkUI = (($) => {
// Constants
const G = window;
const D = document;
// shrink bar
$(G).scroll(() => {
if ($(D).scrollTop() > 100) {
$('body').addClass('shrink');
} else {
$('body').removeClass('shrink');
}
});
return ShrinkUI;
})($);
export default ShrinkUI;