【问题标题】:jquery mobile slidingjquery移动滑动
【发布时间】:2013-03-11 07:36:31
【问题描述】:

我想使用移动 jQuery 在移动设备中垂直滑动图像。我在 jQuery 中找到了一些关于 jCarousel 的链接,关于垂直和水平滑动,在我的情况下,我希望必须在没有箭头的情况下滑动图像。我找到了一个例子,我完全想在没有箭头的情况下做到这一点。

http://bxslider.com/examples/carousel-demystified#example8

http://sorgalla.com/projects/jcarousel/examples/static_vertical.html

谢谢

【问题讨论】:

    标签: jquery jquery-mobile swipe


    【解决方案1】:

    我为此写了simple blog post。检查一下...基本上你需要捕捉向左滑动和向右滑动事件并更改数组中的图像。

     $("#myImagePage").swiperight(function () {
            if (i < (imgURL.length - 1)) {
                i++
            } else {
                i = 0;
            }
            var imgStr = "<img src=" + imgURL[i] + " style='width:100%'>";
            $('#ImageDiv').html(imgStr);
        });
        $("#myImagePage").swipeleft(function () {
            if (i > 0) {
                i--
            } else {
                i = (imgURL.length - 1);
            }
            var imgStr = "<img src=" + imgURL[i] + " style='width:100%'>";
            $('#ImageDiv').html(imgStr);
        });
    

    这是一个工作签名fiddle

    【讨论】:

    • 感谢您的回复,您能告诉我如何通过上下滑动来做到这一点吗?
    • 检查上面的代码并检查我上面给出的小提琴链接。那些正在解释如何做这些事情。
    • 我都检查了,他们只有 swiperight 和 swipeleft 事件。我想对 swipeup 和 swipedown 做同样的事情,jquery mobile 是否支持上下滑动?
    • Nativly 它只支持左右。你可以试试一些插件。看看这个链接swipeplanes-jquery.blogspot.com
    • aa 好的,我找到了这个developingwithstyle.blogspot.com/2010/11/… 我可以通过它上下滑动
    猜你喜欢
    • 2015-07-12
    • 1970-01-01
    • 2012-06-13
    • 1970-01-01
    • 2011-11-16
    • 2011-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多