Struggling for the past few weeks to create a modal dialog using javascript/jQuery. While iOS and Android devices seem to work fine, Windows mobile/Opera mobile often present issues with the modal size. It either requires excessive scrolling or ends up being too short, revealing the background of the page beneath. I am looking for the best way to size the modal correctly and resize it when the device orientation changes.
Current Implementation:
CSS
#dialog {
left: 0; top: 0; right:0; bottom: 0;
position:absolute; z-index:4; color: #424242; font-size:14px; display:none;
background: -moz-linear-gradient(#35848b, #6dbcc9); background: -ms-linear-gradient(#35848b, #6dbcc9); background: -o-linear-gradient(#35848b, #6dbcc9); background: -webkit-linear-gradient(#35848b, #6dbcc9);
}
JAVASCRIPT (TRIGGERED ON DEVICE ORIENTATION CHANGE AND PAGE LOAD)
viewportW = window.innerWidth;
viewportH = window.innerHeight;
$j('#dialog').css({'min-height' : viewportH+'px' });
Looking for solutions to ensure that the dialog is always as tall as the viewport and covers any content below it. Any advice, best practices, or tutorials would be greatly appreciated. Thanks!