JQtouch swipe event/carousel

喜夏-厌秋 提交于 2019-12-25 02:09:19

问题


Ok so what I want isn't quite a slide show. My specific goal would be to have a container that houses a set number of divs and the user can swipe through said divs.If anyone is familiar with Sencha touch, I'm looking for something like the carousel panel. specifically it's going to be a people page that will house a photo of a person and a description. So after doing so research I came across a few options, one being...

 $(function(){
                 // This prevents scrolling
                $('#jqt').bind('touchmove',function(){
                    event.preventDefault();
                });
                $('#p1').bind("swipe",function(event, info){
                    if (info.direction === 'left') {
                        jQT.goTo($('#p2'), 'slideleft');
                                        }
                });
            }); 

My issue with this option is that it swipes the whole page, even the toolbar away. I'm also not doing something right with the styling. is there any extensions that allow for this type of action? Or even a way to code this?


回答1:


jq.mobi has some plugins for things like carousels: https://github.com/appMobi/jQ.Mobi/tree/master/plugins

you could use that code as a starting point. jq.mobi itself is a bit young, but you could use that code as a starting point for a zepto plugin.



来源:https://stackoverflow.com/questions/7808389/jqtouch-swipe-event-carousel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!