Slim banner list to id/imagePath and fix slider click navigation.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -331,6 +331,6 @@
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
<script src="/js/slider.js?v=2"></script>
|
||||
<script src="/js/slider.js?v=3"></script>
|
||||
<script src="/js/app.js?v=2"></script>
|
||||
</html>
|
||||
|
||||
@@ -75,12 +75,11 @@ function initializeMainSlider() {
|
||||
|
||||
function onPointerDown(e) {
|
||||
if (e.pointerType === 'mouse' && e.button !== 0) return;
|
||||
e.preventDefault();
|
||||
dragging = true;
|
||||
dragStartX = e.clientX;
|
||||
dragDelta = 0;
|
||||
suppressClick = false;
|
||||
stop();
|
||||
track.classList.add('is-dragging');
|
||||
try {
|
||||
container.setPointerCapture(e.pointerId);
|
||||
} catch (err) {}
|
||||
@@ -89,7 +88,12 @@ function initializeMainSlider() {
|
||||
function onPointerMove(e) {
|
||||
if (!dragging) return;
|
||||
dragDelta = e.clientX - dragStartX;
|
||||
applyTransform(false);
|
||||
if (Math.abs(dragDelta) > dragThreshold()) {
|
||||
suppressClick = true;
|
||||
if (e.cancelable) e.preventDefault();
|
||||
track.classList.add('is-dragging');
|
||||
applyTransform(false);
|
||||
}
|
||||
}
|
||||
|
||||
function onPointerUp() {
|
||||
@@ -97,8 +101,7 @@ function initializeMainSlider() {
|
||||
dragging = false;
|
||||
track.classList.remove('is-dragging');
|
||||
|
||||
if (Math.abs(dragDelta) > dragThreshold()) {
|
||||
suppressClick = true;
|
||||
if (suppressClick && Math.abs(dragDelta) > dragThreshold()) {
|
||||
if (dragDelta < 0) {
|
||||
next();
|
||||
} else {
|
||||
@@ -107,6 +110,7 @@ function initializeMainSlider() {
|
||||
} else {
|
||||
dragDelta = 0;
|
||||
applyTransform(true);
|
||||
suppressClick = false;
|
||||
}
|
||||
|
||||
dragDelta = 0;
|
||||
|
||||
Reference in New Issue
Block a user