A
A
acspro2015-10-18 16:05:38
JavaScript
acspro, 2015-10-18 16:05:38

How to scroll to the desired block using the fullpage.js plugin and slimscroll?

It's happening here.
colorbar.acspro.ru
I use the fullpage.js plugin

In conjunction with the SlimScroll plugin

The first 3 blocks are FullScreen. In the latter, SlimScroll rises.
In the First block, I have a menu (icon in the upper right corner). It has an item Contacts which refers to id="screen-contacts" So. I've been trying to scroll to the right block for a week now. Tried many options but lacks knowledge and experience. Dear gurus, please tell me how to do it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
acspro, 2015-10-18
@acspro

Who cares about my crutches
for Fullpage.js, I do this

afterLoad: function(anchorLink, index) {
            if(index == '4'){
                if(window.ContactFlag==true)
              $("#products-screens .fp-scrollable").animate({ scrollTop: $('#screen-contacts').position().top }, 600)
          window.ContactFlag=false
            }

    }

Then I create a variable flag
on the button and put a handler
window.ContactFlag=false;
      $(document).on('click','.nav-link-contacts',function(event){
        event.preventDefault() 
        window.ContactFlag=true
        $.fn.fullpage.moveTo($(this).data('link'), 0)
        return false
        })
      $(document).on('click',".footer-link",function(eventObject) {
        $("#products-screens .fp-scrollable").animate({ scrollTop: $('#screen-contacts').position().top }, 600);
            event.preventDefault() 
           $("#products-screens .fp-scrollable").animate({ scrollTop: $('#screen-contacts').position().top }, 600);
      return false;
      })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question