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

On window resizing, Galleria causes the browser to scroll to the top of page #300

Open
john-bai opened this issue Aug 23, 2013 · 1 comment

Comments

@john-bai
Copy link

Tested and reproduced in 3/3 browser tests on Mac 10.6.8:
Safari 5.1.9
Chrome 30.0.1599.14 beta
Firefox 23.0.1

Steps to reproduce:

  1. Go to any theme demo page (example: http://galleria.io/themes/classic/)
  2. Resize window height to add scrollbar to window.
  3. Scroll down to bottom of page.
  4. Resize window width.

Expected:

Browser window's scroll position remains unchanged.

Actual:

Browser window's scroll position changes to 0. User sees top of page.

@toalex77
Copy link

toalex77 commented Nov 25, 2016

I found taht this behaviour (which is still present) turns out when the "responsive" option is turned on, and become very annoying on mobile devices (specially in Google Chrome, where scrolling the page causes the url bar to appear and disappear, and this generate a lot of window.resize events).
I've worked around it by replacing the line 4731 ($container[ m ]( 'auto' );) in the function Galleria.prototype.resize, with these:

if( m == 'width' )$container[ m ]( $container.parent().innerWidth() );
if( m == 'height' )$container[ m ]( $container.parent().innerHeight() );

But I think that a better fix is needed.

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

2 participants