Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollToFixed not working when scrolled content has 100vh height #238

Open
jschroeerluecke opened this issue Oct 5, 2017 · 0 comments
Open

Comments

@jschroeerluecke
Copy link

jschroeerluecke commented Oct 5, 2017

My content is being scrolled and it has height set to 100vh.
But scrollToFixed won't work with that height, if I change that it works perfectly.
But I need the 100vh height. Is there a work around ?

I am using this code

var summaries = $('.summary');
    summaries.each(function(i) {
    var summary = $(summaries[i]);
    var next = summaries[i + 1];
    summary.scrollToFixed({
        marginTop: $('#header').outerHeight(true),
        limit: function() {
        var limit = 0;
         if (next) {
            console.log($(next).offset().top - $(this).outerHeight(true) - 0);
            limit = $(next).offset().top - $(this).outerHeight(true) - 0;
        }
        return limit;
        },
        zIndex: 2
    });
});

I am using this on mobile devices with cordova as a web-app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant