非常喜欢这个旋转木马:http://www.professorcloud.com/mainsite/carousel.htm
除了我需要为iOS和Android添加触摸/滑动事件之外,它完全符合我的演示需求。
基本上,如果用户向左或向右滑动(是正确的术语吗?),旋转木马就会向该方向移动,就像按下左或右按钮一样。
我尝试使用此插件:http://plugins.jquery.com/project/Touchwipe-iPhone-iPad-wipe-gesture,然后尝试调整(hack)旋转木马插件以便监听这些事件。
$(container).bind('touchwipe',this,function(event){
wipeLeft: function() { alert("left"); }
});
但是这会生成语法错误。我对创建插件的了解不足,不知道在这里允许什么。
从插件中可以看出,左/右滚动功能在这里。
// Setup the buttons.
$(options.buttonLeft).bind('mouseup',this,function(event){
event.data.rotate(-1);
return false;
});
$(options.buttonRight).bind('mouseup',this,function(event){
event.data.rotate(1);
return false;
});
我想我需要连接到这些设备。
我应该使用额外的插件来创建擦除事件,还是尝试官方的触摸事件?
谢谢!