Lightweight swipe lib
Who can suggest very lightweight swipe lib
Or perhaps I can do it by myself?
14 Replies
define "lightweight"
if it is super fast, but takes 300kb, is that lightweight?
if it is slow and takes just 5kb, is that lightweight?
also, what do you want to do with it?
just touch? support for the disgusting horrible unusable drag emulation using the mouse? support for buttons?
which features do you need?
I don't about the weight, just as small as it could be
Just for regular swipe for mobile devices
Like what a carousel usually have
For swipe images
For swipe blocks of text
and how will you handle non-touch devices?
emulating swipe with the mouse is gross, but not emulating it may require work, depending on the library
By regular mouse listener
Click
And for mobile I wanna use both
Swipe and click
so, for a non-touch device, you will show everything?
please just implement yourself if you have time
otherwise people usually uses swiper.js
generally libs are not "light weight" because they try to target sorts of problem
you can discard functionality from swiper lib source code also if you really want
i was getting there, but first needed to know what he wants
there's snippets online that do everything
I have section like that
I wanna this to be swipable for left and right
On the other hand I have click event so use can click for half hidden blocks
It's just addition to my interface for touch screens
Also like for a regular pop up with image I have arrows and keyboard event
But I also want it to be swipable
what's supposed to happen with the swipe?
Switch current object on the top
https://stackoverflow.com/a/23230280 <-- you can use something like this, for example
what this does is to detect when the touch started and record the coordinates, then check where the touch is moving to
you can even use the next answer, which is even smaller
thanks !
you're welcome