最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Drag to change image slide with jquery like in iphone - Stack Overflow

programmeradmin1浏览0评论

Am using supersized jquery plugin for my site. It es 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

/

Am using supersized jquery plugin for my site. It es 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./project/supersized/

Share Improve this question edited Aug 1, 2011 at 6:39 esafwan asked Aug 1, 2011 at 6:10 esafwanesafwan 18.1k35 gold badges110 silver badges170 bronze badges 2
  • 3 So what's keeping you from doing it? – Semyazas Commented Aug 1, 2011 at 6:22
  • I have updated question. I dont know how to detect swipe like movement in jquery and how to detect in which direction. – esafwan Commented Aug 1, 2011 at 6:27
Add a ment  | 

1 Answer 1

Reset to default 6

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 pare that to your initially captured position. While this is highly theoretical, check here Recreate Iphone Swipe effect using jQuery for a live example.

发布评论

评论列表(0)

  1. 暂无评论