Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

handleLink buggy on safari iOS #84

Open
Bobz-zg opened this issue Aug 9, 2016 · 0 comments
Open

handleLink buggy on safari iOS #84

Bobz-zg opened this issue Aug 9, 2016 · 0 comments

Comments

@Bobz-zg
Copy link

Bobz-zg commented Aug 9, 2016

Works very bad when I try to use handleLink to define scrollTop position, if removed all works well.
But problem is that I have sticky nav at top and want to calculate my own offset.
If I add offset as data-attribute to each section then also all works fine, so I'm not sure is there something wrong with my code or what..

It just scrolls to random parts of page.

$(document).ready( function($) {

        var s = skrollr.init({
            forceHeight: true,
            edgeStrategy: 'set',
            smoothScrolling: true,
            easing: {
                WTF: Math.random,
                inverted: function(p) {
                    return 1-p;
                }
            }
        });

        skrollr.menu.init(s, {
            animate: true,
            easing: 'sqrt',
            complexLinks: false,
            handleLink: function(link) {
                $menu = $(link).attr('href');
                $pos  = parseInt($($menu).offset().top) - $('.banner').outerHeight();

                return Math.abs($pos);
            },
            change: function(newHash, newTopPosition) {

                $('body').removeClass('nav-active');

                return newTopPosition;
            },
            updateUrl: false
        });
    });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant