Sunday, March 24, 2013

jquery mobile を使いながら swipe js を使う。

jquery mobile を使いながら swipe js を使う。
  • Swipe の初期化は以下のようなタイミングで行う。pageinit ではなく、pageshow にしないと width がおかしくて表示されない。
    $( '#home' ).live( 'pageshow',function(event){
        var elem = document.getElementById('mySwipe');
        window.mySwipe = new Swipe(elem, {
          // startSlide: 4,
          // auto: 3000,
          // continuous: true,
          // disableScroll: true,
          // stopPropagation: true,
          // callback: function(index, element) {},
          // transitionEnd: function(index, element) {}
        });
    });
    
  • 余白が気になる場合は、以下のようなのを追加しておく
    .ui-content{
      padding:0;
    }
    

No comments:

Post a Comment