Recently, I am idle and think about it. It is actually quite simple, mainly because scrollleft can solve the conflict between click events and drag and drop sliding events.
Because I believe most of the results can be used not only to display images, but also to display buttons. This is also the main trouble.
Solution: Replace the click event with the mousedown event, because the mousedown event of elements inside the container is before the mousedown event of the container.
If you click a container, it is after the container's mousedown event. After you click the button, both mousedown events will be triggered.
In this way, we set a settimeout timer in the button's mousedown event, and delegate the real Click Event function to 10 ms before execution.
In mousemove, cancel the timer. If you move it after clicking the mouse, the timer will be canceled.
If it is released without moving, click the event 10 ms later.
Another is how to ensure that the text is not selected and the image is not dragged,
There is a small plug-in for someone else to download, and a sentence is added in it, in order to make firefox compatibility.
There should be no other problems. The only problem is that js is always a little smoother.
Posted in: CSS & HTML Tags: jquery, iphone-like, slide