问题
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