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

Browser resize on mobile browsers #43

Open
fannta1 opened this issue Sep 21, 2014 · 2 comments
Open

Browser resize on mobile browsers #43

fannta1 opened this issue Sep 21, 2014 · 2 comments

Comments

@fannta1
Copy link

fannta1 commented Sep 21, 2014

When you scroll down on a tablet or phone using any mobile browser (Safari on iOS too) they changes UI and minimize URL bar. That leads to screen height change and so the resize function is called. I found it very anoiying since it is only changing height and not width, the result is the same. Is it somehow possible to check only width and if it's changed,then fire the function?

@griffindor55
Copy link

I get this issue as well. It causes the page to reload multiple times.

@haheute
Copy link

haheute commented Dec 3, 2014

perhaps this helps:

function collage(){
    //do collagePlus
};

var timer = null;
var width = $(window).width();
$(window).bind('resize', function() {
    if($(window).width() != width){
        // hide all the images until we resize them
        $('.Collage').css('opacity', 0.2);
        // set a timer to re-apply the plugin
        if (timer) clearTimeout(timer);
        timer = setTimeout(collage, 250);
        width = $(window).width();
    }
});

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

3 participants