fix swipe on iphone on lightbox
This commit is contained in:
@@ -131,7 +131,7 @@ function dis2019_header_scripts()
|
||||
wp_register_script('ftellipsis', get_template_directory_uri() . '/js/lib/ftellipsis.min.js', array(), '1.0.0'); //
|
||||
wp_enqueue_script('ftellipsis'); // Enqueue it!
|
||||
|
||||
wp_register_script('touchSwipe', get_template_directory_uri() . '/js/lib/jquery.touchSwipe.min.js', array('jquery'), '1.6.18'); //
|
||||
wp_register_script('touchSwipe', get_template_directory_uri() . '/js/lib/jquery.touchSwipe-1.6.18.min.js', array('jquery'), '1.6.19'); //
|
||||
wp_enqueue_script('touchSwipe'); // Enqueue it!
|
||||
|
||||
wp_register_script('dis2019scripts', get_template_directory_uri() . '/js/scripts.js', array(
|
||||
|
||||
2110
js/lib/jquery.touchSwipe-1.6.19.js
Normal file
2110
js/lib/jquery.touchSwipe-1.6.19.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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