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

Allow scrollz to work properly with jQuery Mobile Panel widgets #30

Open
gabaum10 opened this issue May 13, 2015 · 0 comments
Open

Allow scrollz to work properly with jQuery Mobile Panel widgets #30

gabaum10 opened this issue May 13, 2015 · 0 comments

Comments

@gabaum10
Copy link

RIght now, if you try to use the auto-init feature via the data-scrollz="pull" attribute on a jQM page that has a panel, all sorts of craziness ensues. I was able to work around this by initializing it after the panel has been rendered on a specific target inside the panel. The only problem with this is it breaks a whole bunch of built in scrollz functionality. I have to add all sorts of weird hacks like this:

        if(!$('.scrollz-init', view.$el).exists()) {
            view.$scrollContainer.scrollz({
                pull: true,
                emulateTouchEvents: true,
                styleClass: 'scrollz-init'
            });
            // have to hide the header before anything else happens because scrollz doesn't do it by default
            view.$scrollContainer.scrollz('hidePullHeader', false);
            // also because the height calulations don't like the panel, we have to set it manually :(
            view.$scrollContainer.scrollz('height', $(window).height()-97 /*top bar and bottom bar height*/);
        } 

And then you have to add a window.resize listener to update the heights because by setting the height programmatically, it no longer updates automatically. This would be really nice if the plugin just worked when initialized in a panel.

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