fix swipe on iphone on lightbox
This commit is contained in:
@@ -1123,6 +1123,18 @@
|
||||
|
||||
const lightBoxMaxHeight = isMobile ? '65%' : '80%'
|
||||
|
||||
function prevdev(e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
const disableScroll = function () {
|
||||
document.addEventListener('touchmove', prevdev, { passive: false })
|
||||
}
|
||||
|
||||
const enableScroll = function () {
|
||||
document.removeEventListener('touchmove', prevdev, { passive: false })
|
||||
}
|
||||
|
||||
//http://www.jacklmoore.com/colorbox/
|
||||
const colorboxSettings = {
|
||||
transition: 'none',
|
||||
@@ -1136,7 +1148,9 @@
|
||||
next: '',
|
||||
close: '',
|
||||
xhrError: 'A tartalom betöltése nem sikerült. Kérlek próbáld meg később.',
|
||||
imgError: 'A kép betöltése nem sikerült. Kérlek próbáld meg később.'
|
||||
imgError: 'A kép betöltése nem sikerült. Kérlek próbáld meg később.',
|
||||
onOpen: disableScroll,
|
||||
onClosed: enableScroll
|
||||
|
||||
}
|
||||
|
||||
@@ -1144,17 +1158,10 @@
|
||||
$('#cboxOverlay, #colorbox').swipe({
|
||||
swipeLeft: function () {
|
||||
$.colorbox.next()
|
||||
|
||||
},
|
||||
swipeRight: function () {
|
||||
$.colorbox.prev()
|
||||
},
|
||||
swipeUp: function () {
|
||||
return false
|
||||
},
|
||||
swipeDown: function () {
|
||||
return false
|
||||
},
|
||||
})
|
||||
|
||||
// lightbox for galleries
|
||||
|
||||
Reference in New Issue
Block a user