我想集成滑动手势到整个网页。触发器将是整个包装器div,目标将是另一个html文件。在每个html上,我想设置向左和向右滑动的html链接。没有必要上上下下。
我看过jQuery移动开发,但没有运气:(
发布于 2013-07-17 00:00:22
我不确定我是不是太晚了,但要回答这个问题,你必须执行以下操作:
真的不需要重新制作swipe功能,SwipeJS很棒。请确保您使用的是SwipeJS html结构,并且只加载到每个可滑动的div中。希望这能回答这个问题。
发布于 2013-01-18 18:03:32
这是我在一些应用程序中使用的触摸屏拖拽/滑动修复。
(function(b)
{
b.support.touch = "ontouchend" in document;
if (!b.support.touch)
{
return;
}
var c = b.ui.mouse.prototype,
e = c._mouseInit,
a;
function d(g, h)
{
if (g.originalEvent.touches.length > 1)
{
return;
}
g.preventDefault();
var i = g.originalEvent.changedTouches[0],
f = document.createEvent("MouseEvents");
f.initMouseEvent(h, true, true, window, 1, i.screenX, i.screenY, i.clientX, i.clientY, false, false, false, false, 0, null);
g.target.dispatchEvent(f);
}
c._touchStart = function(g)
{
var f = this;
if (a || !f._mouseCapture(g.originalEvent.changedTouches[0]))
{
return;
}
a = true;
f._touchMoved = false;
d(g, "mouseover");
d(g, "mousemove");
d(g, "mousedown");
};
c._touchMove = function(f)
{
if (!a)
{
return;
}
this._touchMoved = true;
d(f, "mousemove");
};
c._touchEnd = function(f)
{
if (!a)
{
return;
}
d(f, "mouseup");
d(f, "mouseout");
if (!this._touchMoved)
{
d(f, "click");
}
a = false;
};
c._mouseInit = function()
{
var f = this;
f.element.bind("touchstart", b.proxy(f, "_touchStart")).bind("touchmove", b.proxy(f, "_touchMove")).bind("touchend", b.proxy(f, "_touchEnd"));
e.call(f);
};
})(jQuery);正如Kevin所写的,您可以使用ajax加载您需要的另外两个页面,然后使用swipe触发器对它们进行动画处理以使其进入。
https://stackoverflow.com/questions/14387448
复制相似问题