diff --git a/src/js/jquery.swipebox.js b/src/js/jquery.swipebox.js index f2fd0155..ab847e45 100644 --- a/src/js/jquery.swipebox.js +++ b/src/js/jquery.swipebox.js @@ -296,9 +296,8 @@ bars.addClass( 'visible-bars' ); $this.setTimeout(); - $( 'body' ).bind( 'touchstart', function( event ) { + $( 'body' ).addClass( 'touching' ).bind( 'touchstart', function( event ) { - $( this ).addClass( 'touching' ); index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) ); endCoords = event.originalEvent.targetTouches[0]; startCoords.pageX = event.originalEvent.targetTouches[0].pageX; @@ -437,7 +436,7 @@ } ); $( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' ); - $( '.touching' ).off( 'touchmove' ).removeClass( 'touching' ); + $( '.touching' ).off( 'touchmove' ); } ); }, @@ -911,6 +910,7 @@ closeSlide : function () { $( 'html' ).removeClass( 'swipebox-html' ); $( 'html' ).removeClass( 'swipebox-touch' ); + $('body').removeClass('touching'); $( window ).trigger( 'resize' ); this.destroy(); },