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

hidePreview() hides expanded preview on scrolling (iphone) #17

Open
coderbit-net opened this issue Sep 23, 2014 · 3 comments
Open

hidePreview() hides expanded preview on scrolling (iphone) #17

coderbit-net opened this issue Sep 23, 2014 · 3 comments

Comments

@coderbit-net
Copy link

Hi, first of all thanks for a grate js ))

I have an issue on iphone. If I click on a thumb, it opens an "expander", but as soon as I start to scroll, expanded block hides automatically. Trying to debug, I figured out that the reason is inside of initEvents(), somehow it detects iphones scrolling as window reaizing. Commenting out //hidePreview(); solves the problem on iphone but makes crap to desktop resizing. Is there a way to separate this to triggers?

Best regards.

@coderbit-net
Copy link
Author

Hi again,
so, i figured out that "expanded" block hides automatically only if the window is on its top.
at this moment iOS safari browsers top bar (where you input url) transforms from big to small.
After this top line gets small all next expanded blocks are scrolled as usuall, without closing automatically.

@amichel86
Copy link

Hi Alex, thanks for your answer I commented out line #298 and it seems like the problem is solved. I am using Firefox responsive view and the original script was closing the expanded preview when the window width was at a certain resolution.

@YuccaV2
Copy link

YuccaV2 commented Jun 27, 2022

Very old post but many mobile browsers hide, show or resize their menu bar when scrolling up or down, which effectively resizes the window. So I solve this by catching the width of the window, on initEvents function : `var cachedWidth = $(window).width();
$window.on( 'debouncedresize', function() {

		var newWidth = $(window).width();
				if(newWidth !== cachedWidth){
					//DO RESIZE HERE
					cachedWidth = newWidth;
					scrollExtra = 0;
					previewPos = -1;
					saveItemInfo();
					getWinSize();
					var preview = $.data( this, 'preview' );
					if( typeof preview != 'undefined' ) {
						hidePreview();
					}
				}

	} );`

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