<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.touchswipe/1.6.19/jquery.touchSwipe.min.js"></script>
<div id="test">Swipe</div>
#test {
width: 256px;
height: 128px;
border-radius: 8px;
background-color: #0d324d;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-weight: bold;
user-select: none;
}
$(function () {
$("#test").swipe({
swipe: function (
event,
direction,
distance,
duration,
fingerCount,
fingerData
) {
$("#test").text("You swiped " + direction);
},
threshold: 75
});
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.