0

我想做一个移动网页,在网页中间,我可以左右滑动手指并在图像之间滚动。

一张照片来证明:

示范 我希望能够用手指在审查后的图像之间滑动。我该怎么做这样的事情?

提前致谢!

4

1 回答 1

0

您正在寻找类似封面流的东西。这可能会引导您朝着正确的方向前进: http: //andrebrov.net/dev/carousel/

来源链接:http: //forum.jquery.com/topic/jquery-mobile-carousel-widget

GITHUB 链接:https ://github.com/andrebrov/jqm.carousel

下面是 HTML 的样子:

<div style="height:460px;width:300px;">
    <div id="carousel" class="carousel">
      <div id="carousel_scrollpane" class="carousel-content">
        <div id="carousel_content" class="carousel-content-scroller"></div>
      </div>

      <div id="carousel_nav" class="carousel-nav">
        <div id="carousel_mid" class="carousel-mid"></div>
      </div>
    </div>
  </div>

然后,初始化会这样:

var carousel = new $.widgets.Carousel({
    uuid: "carousel",
    args: {
        "scrollInterval": 600,
        "itemWidth": 290
    },
    value: [{
        "title": "Tron.Legacy",
        "image": "images/1.jpg"
    }, {
        "title": "Yogi Bear",
        "image": "images/2.jpg"
    }, {
        "title": "The Chronicles of Narnia: The Voyage of the Dawn Treader",
        "image": "images/3.jpg"
    }, {
        "title": "The Fighter",
        "image": "images/4.jpg"
    }, {
        "title": "Tangled",
        "image": "images/5.jpg"
    }]
});

希望这可以帮助!

于 2013-06-23T18:24:56.937 回答