Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* detect IE11 */
- var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
- $('.results-carousel-sidebar').flickity(resultsCarouselSidebar);
- // Prevent page scroll while dragging/swiping Flickity carousels
- if (isIE11 == false) {
- var tapArea, startX;
- tapArea = document.querySelectorAll('.reviews-carousel, .reviews-carousel-sidebar, .results-carousel, .results-carousel-sidebar');
- startX = 0;
- for (var item of tapArea) {
- item.ontouchstart = function(e) {
- startX = e.touches[0].clientX;
- };
- item.ontouchmove = function(e) {
- if (Math.abs(e.touches[0].clientX - startX) > 5 && e.cancelable ) {
- e.preventDefault();
- }
- };
- }
- } else {
- console.log("it's undefined");
- }
Advertisement
Add Comment
Please, Sign In to add comment