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

Scrollbar hidden on page load #113

Open
pierluigi opened this issue Jul 19, 2013 · 0 comments
Open

Scrollbar hidden on page load #113

pierluigi opened this issue Jul 19, 2013 · 0 comments

Comments

@pierluigi
Copy link

If there are images without the height attribute declared, the scrollbar will not be shown due to an incorrect height calculation.

Here's a demo : http://www.negativelabs.com/dev/tests/jqm-iscroll/

(resize your window and the scrollbar will reappear instantly).

I guess this is due to the images not having been loaded yet when the iScroll is initialized. Just for testing I've added a timeout of 100ms before the element.iscrollview() initialization line and that seems to "fix" the issue.

What would be the best way to fix this without setting image height explicitly (in our project the images must have fluid dimensions that scale together with the window).

Thanks

UPDATE
A more appropriate way to alleviate the issue is by replacing

elements.iscrollview();

with

elements.each(function(i, e) {
    $('img', e).load(function() {
        $(e).iscrollview();
    });
});

(at the bottom of jquery.mobile.iscrollview.js )

But it's a workaround really... any other ideas?

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