2014-04-11 104 views

回答

0

在這裏,你有an example

它做得相當快,但也許有一個更簡單的方法來做到這一點。基本上它是關於玩回調和CSS樣式。

$('#fullpage').fullpage({ 
    slidesColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'], 
    onLeave: function (index, direction) { 
     if (index == 1 && direction == "down") { 
      var menuTop = $(window).height() - $('#myMenu').height(); 


      $('#myMenu').css('top', '').css('bottom', menuTop + 'px'); 
     } 
     if (index == 2 && direction == "up") { 
      var menuTop = $(window).height() - $('#myMenu').height(); 

      $('#myMenu').animate({ 
       top: menuTop + 'px', 
      }, 300); 

      $('#myMenu').css('bottom', ''); 
     } 

    } 
});