製作手機相簿 全屏滾動外掛程式fullpage.js

來源:互聯網
上載者:User

標籤:

今天是端午自己做了一個小的送祝福連結 

 這裡用到了fullpage外掛程式

$(‘#container‘).fullpage({
  navigation: false,        //navigation是否顯示導航,預設為false

  easing: ‘easeInQuart‘,

  scrollingSpeed: 400,
  loopBottom: false,
  loopTop: false,
  afterLoad: function(anchorLink, index) {//最後一頁不顯示向上滑動 此處index設定從1開始的
    if(index == page_num){
    $(‘.slide_up_tip‘).hide();
  }else{
    $(‘.slide_up_tip‘).show();
  }

  onLeave: function(index, nextIndex, direction) {//當頁面過長導致安卓卡頓,使用下面的方法,需要在onload後顯示前兩頁

    var index = index - 1;             //讓index和jquery eq一樣從0開始,省的看著心煩
    if(direction == ‘down‘){          //index大於第2頁執行
      if(index >= 1) $(‘.fp-section:eq(‘+(index-1)+‘)‘).css(‘visibility‘, ‘hidden‘);

                        //index小於倒數第2執行
      if(index <= page_num - 2) $(‘.fp-section:eq(‘+(index+2)+‘)‘).css(‘visibility‘, ‘visible‘);
    }else{               //index小於倒數第2執行
      if(index <= page_num - 2) $(‘.fp-section:eq(‘+(index+1)+‘)‘).css(‘visibility‘, ‘hidden‘);
                      //index大於第2頁執行
      if(index >= 1) $(‘.fp-section:eq(‘+(index-2)+‘)‘).css(‘visibility‘, ‘visible‘);  
    }
  }
})

 

官方地址:https://github.com/alvarotrigo/fullPage.js

  


製作手機相簿 全屏滾動外掛程式fullpage.js

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.