Javascript 向下滑动不';无法使用fullPage.js

Javascript 向下滑动不';无法使用fullPage.js,javascript,slidedown,fullpage.js,Javascript,Slidedown,Fullpage.js,伙计们。我在试图理解如何修复它时感到头疼,但我根本不懂JavaScript。所以,请帮帮我。 问题是,当启用fullPage.js时,向下滚动(可能是向上滚动)不起作用。 参见代码 向下滑动: jQuery(document).ready(function(e){ // -- menu ---\ $(window).scroll(function () { var html = document.documentElement; // $(".blockMenu").c

伙计们。我在试图理解如何修复它时感到头疼,但我根本不懂JavaScript。所以,请帮帮我。 问题是,当启用fullPage.js时,向下滚动(可能是向上滚动)不起作用。 参见代码

向下滑动:

    jQuery(document).ready(function(e){
// -- menu ---\
$(window).scroll(function () {
  var html = document.documentElement;
       // $(".blockMenu").css("top",$(document).scrollTop())
       if($('html').width()>1000){
         if($(document).scrollTop()>=200){
          $('.hedMenu').slideUp()
          $('.hedMenu2').slideDown()
        }
        else{
          $('.hedMenu2').slideUp()
          $('.hedMenu').slideDown()
        }
      }
    })
})
全文:

 $(document).ready(function() {
    $('#fullpage').fullpage({
     sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', 'whitesmoke', '#ccddff'],
     anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', 'lastPage'],
     menu: '#menu',
     afterLoad: function(anchorLink, index){

        //section 2
        if(index == 2){
          //moving the image
          $('#section1').find('img').delay(500).animate({
           left: '0%'
         }, 1500, 'easeOutExpo');

          $('#section1').find('p').first().fadeIn(1800, function(){
           $('#section1').find('p').last().fadeIn(1800);
         });;

        }

       //section 3
       if(anchorLink == '3rdPage'){
          //moving the image
          $('#section2').find('.intro').delay(500).animate({
           left: '0%'
         }, 1500, 'easeOutExpo');
        }
      }
    });

  });

HTML不是物理标记,因此它没有宽度。

如果($(document).scrollTop()>=200){
在您的代码中不起作用,详细信息如下:

fullPage.js实际上不会滚动网站,但会更改网站的top或translate3d属性。只有在使用fullPage.js选项scrollBar:true或autoScrolling:false时,它才会以scrollTop属性可访问的方式滚动网站

这就是为什么您应该使用回调,或者使用fullPage.js的
scrollBar:true
选项

  • “滑动下降”、“滑动上升”或“滑动切换”持续时间应小于或等于200
  • 完成动画后使用reBuild()
  • 例如:

    $(“#单击我”)。单击(函数(){
    $(“#book”)。向下滑动(150,函数(){
    完整页_api.reBuild();
    });
    });
    
    谢谢,但不起作用。如果我删除第二个代码,它会很好地工作(使用html标记)。