スクロールをアニメーションが終わるまで固定
import $ from 'jquery';
import { $WINDOW, isMobile } from '../helpers';
import 'mobileEvents';
import { _debounce } from 'lodash.debounce';
import ViewBase from '../view_base';
/**
* スクロール固定
*/
export default class extends ViewBase {
constructor(el) {
super(el);
this.$body = $('body');
}
initialize() {
super.initialize();
}
bind() {
if(isMobile){
$(window).on('load', this.onload);
this.$el.on('oTransitionEnd mozTransitionEnd webkitTransitionEnd transitionend', this.transitionEnd);
}else{
this.$el.on('oTransitionEnd mozTransitionEnd webkitTransitionEnd transitionend', this.transitionEnd);
}
}
transitionEnd() {
setTimeout(function(){
$('body').removeClass('is-fix_scroll');
$(window).off('.noScroll');
},2000);
}
onload() {
$(window).on('touchmove.noScroll', function(e) {
e.preventDefault();
});
}
}