0

on my site I have html structure like:

<div>
   <div class="w1">
       <div class="s1">...</div>
       <div class="s2">...</div>
       <div class="s3">...</div>
   </div>
   <div class="w2">....
</div>

And I init scrollify on w1 and it works fine. But I want to enable normal scrolling after last sections (s3), so based on scrollify - scroll normally after last section? I have added

  $(document).on('scroll', function (e) {
        var top = $('.section-class-name:last').offset().top;
        var screenTop = $(document).scrollTop();

        if (top > screenTop && $.scrollify.isDisabled()) {
            $.scrollify.enable();
            $.scrollify.update();
        } else if (top <= screenTop && !$.scrollify.isDisabled()) {
            $.scrollify.disable();
        }
    });

with slight change (<= ratehr then < so it will be disabled on last section) and it works kind of fine : it it disabling scrollify on last section and scrollify wheelHandle returns tru, but nothing happens on site, its not scrolling up or down. Do you guys have any if its even possible to achive what I am aiming for?

Community
  • 1
  • 1
szczdsz
  • 1
  • 1

1 Answers1

0

Just set your w2 class as an interstitialSection. Also, there's no reason to add your own scroll events, use Scrollify's callbacks instead.

Luke Haas
  • 672
  • 2
  • 6
  • 16
  • I dont think its a solution to my problem, based on my structure and aprouch I would need to add many classes to interstitialSection, w3,w4 etc. I woudl rather try to add w1 as only one that it should work. – szczdsz Mar 17 '17 at 12:16
  • If you're able to control your page structure then just wrap everything below w2 inside a wrapper and set that as an interstitialSection. – Luke Haas Mar 17 '17 at 12:26
  • Also, there would never be a need to add lots of classes to interstitialSection as you can just have a single class that's applied to multiple elements – Luke Haas Mar 17 '17 at 12:26
  • I have dynamic page structure, and w1 is optional, I would like to avoid adding classes to other page sections/elements/widgets based on usage of w1, thats why I was trying to have work on this class ratehr then dont wokr on this approuch. – szczdsz Mar 17 '17 at 13:18
  • Ok, Sounds like Scrollify isn't the right thing for your needs. It's a full page solution, there isn't a way to just use it for part of the page – Luke Haas Mar 17 '17 at 13:22