Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag to change image slide with jquery like in iphone

Am using supersized jquery plugin for my site. It comes with button for next and previous slides. I want to implement drag to change feature in it. If some one click and move mouse to right it should act as the next slide button.

But how can i do it with jquery? How can i know when user click n drag to left/right

http://buildinternet.com/project/supersized/

like image 325
esafwan Avatar asked Aug 01 '11 06:08

esafwan


1 Answers

jQuery recognizes mouseUp, mouseDown and mouseMove as events.

You would have to capture the mouseposition on mouseDown, update the position while it's moving and compare that to your initially captured position. While this is highly theoretical, check here Recreate Iphone Swipe effect using jQuery for a live example.

like image 152
Semyazas Avatar answered Sep 23 '22 10:09

Semyazas