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

Modal jump to top of the screen problem #202

Open
bobbyrinaldy opened this issue Jul 11, 2018 · 6 comments
Open

Modal jump to top of the screen problem #202

bobbyrinaldy opened this issue Jul 11, 2018 · 6 comments

Comments

@bobbyrinaldy
Copy link

Help me please,

I Have a modal using iziModal . its working fine, but i have an issues with the modal pop up

when i use

$('#modal').iziModal('open');

The modal jump to the top, while i have scroll down the page. looks like it jump to my nav bar or something. i want to the modal is stay on the place where i click it.

can anyone help me with this?

@vitoralvesdev
Copy link

Same problem here :x

@chupzzz
Copy link

chupzzz commented Sep 7, 2018

That's strange: I have 2 different sites with iziModal. At first - no scroll to top, on second - there is. Looks like it depends on some markup but I can't get exactly what (tried many different things but still can't find).

Trying with both methods:
$('#modal').iziModal('open');
and with data-attr - same story.

@chupzzz
Copy link

chupzzz commented Sep 8, 2018

I did some investigation. This behavior happens when content in modal too long, longer than window, so the script adds this class to : iziModal-isAttached (at recalcLayout()). Only because of this page on first site scrolls to top, while on second site - don't. I checked all I can find - still have no idea why this happens.

My temporary and dirty solution - to comment lines from 1226 to 1228 (iziModal.js).

@berpcor
Copy link

berpcor commented Sep 25, 2019

How to solve problem???

@berpcor
Copy link

berpcor commented Sep 25, 2019

Problem exists even if you turn off history (hash navigation is not the reason).

@raczger
Copy link

raczger commented Feb 17, 2020

In iziModal.js remove this line (488):
$('html').addClass(PLUGIN_NAME+'-isOverflow');
And this too (644):
$('html').removeClass(PLUGIN_NAME+'-isOverflow');

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

5 participants