|
|
@ -670,6 +670,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} }); |
|
|
|
window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} }); |
|
|
|
}()); |
|
|
|
}()); |
|
|
|
|
|
|
|
|
|
|
|
/* ---------------------------------- |
|
|
|
/* ---------------------------------- |
|
|
|
* SLIDER v2.0.1 |
|
|
|
* SLIDER v2.0.1 |
|
|
|
* Licensed under The MIT License |
|
|
|
* Licensed under The MIT License |
|
|
@ -879,7 +880,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
handle.style.webkitTransform = 'translate3d(' + distanceX + 'px,0,0)'; |
|
|
|
handle.style.webkitTransform = 'translate3d(' + distanceX + 'px,0,0)'; |
|
|
|
|
|
|
|
|
|
|
|
toggle.classList[(distanceX > (toggleWidth/2 - handleWidth/2)) ? 'add' : 'remove']('active'); |
|
|
|
toggle.classList[(distanceX > (toggleWidth / 2 - handleWidth / 2)) ? 'add' : 'remove']('active'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener('touchend', function (e) { |
|
|
|
window.addEventListener('touchend', function (e) { |
|
|
@ -891,7 +892,7 @@ |
|
|
|
var toggleWidth = toggle.clientWidth; |
|
|
|
var toggleWidth = toggle.clientWidth; |
|
|
|
var handleWidth = handle.clientWidth; |
|
|
|
var handleWidth = handle.clientWidth; |
|
|
|
var offset = (toggleWidth - handleWidth); |
|
|
|
var offset = (toggleWidth - handleWidth); |
|
|
|
var slideOn = (!touchMove && !toggle.classList.contains('active')) || (touchMove && (distanceX > (toggleWidth/2 - handleWidth/2))); |
|
|
|
var slideOn = (!touchMove && !toggle.classList.contains('active')) || (touchMove && (distanceX > (toggleWidth / 2 - handleWidth / 2))); |
|
|
|
|
|
|
|
|
|
|
|
if (slideOn) { |
|
|
|
if (slideOn) { |
|
|
|
handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)'; |
|
|
|
handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)'; |
|
|
|