jquery - Fixed position modal scrolling/focus -


i built js/css modal system. project using bootstrap modals, pushing limits putting forms , large amounts of content inside of them weren't scrolling or focus correctly on mobiles.

the modal system can triggered here clicking of footer links (privacy policy, terms , conditions, etc.).

general problem: modal has fixed position css causes body scroll down when scroll on modal. did best try , make not matter, through "overflow", "height" , light "z-index" stuff. worked on ios, not on android found out.

specifics: x button isn't clickable when body's scroll position isn't @ top, , modal won't scroll until body's scroll position @ top.

i understand forcing it... conversion important site, , important not reload page , keep them in "the funnel." should change way set instead of trying display scrollable element on top of body, replaces body temporarily? or there css fix i'm missing? i'm pretty stuck.

here's ended using! html...

<body>    <main id="main">     site content   </main>    <aside id="modals">     modals in here   </aside>  </body> 

for css, did media query targeted mobiles. css displayed of modals in standard way (not position:fixed), using position:static , display:block. content, though "modal", being displayed in 100% standard, supported way. there no bugs associated scrolling/focus.

the js adding class body using in css selectors. rest of js, going post libraries github , make them reusable. +1 if you're interested!

this system still live here.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -