I'm building a website where a part can be shown full screen. Unfortunately when the div is shown in full screen mode, the dialog is hidden behind the full screen div. Only after pressing escape to undo full screen, the dialog is visible.
See code below. Button 'Show full screen' makes the div full screen. Button 'Show dialog' supposes to show the dialog, but does this only when the div is not full screen.
What am I'm doing wrong?
Thanks!
[code] <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css" type="text/css"> <style> body {background-color:lightgrey;} </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js" defer></script> </head> <body> <div>This text won't be full screen.</div> <button id="idBtnShowFullScreen">Show full screen</button><br /><br /> <div id="idContentToShowFullScreen">This text will be full screen.<br /> <button id="idBtnShowDialog">Show dialog</button><br /> <div id="idDialog" title=" "><p><span id="idDialogMessage"> </span></p></div> </div> <script> function requestFullscreen(id) { var elem = $(id)[0], isFullscreenSupported = false; if (elem.requestFullscreen) { elem.requestFullscreen(); isFullscreenSupported = true; } else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); isFullscreenSupported = true; } else if (elem.mozRequestFullScreen) { elem.mozRequestFullScreen(); isFullscreenSupported = true; } else if (elem.webkitRequestFullscreen) { elem.webkitRequestFullscreen(); isFullscreenSupported = true; } return isFullscreenSupported; } function customAlert(title, message) { "use strict"; $("#idDialogMessage").html(message);
// Whenever `document.title` changes, update the Iframe's
title to
// prettify the back/next history menu entries. Since IE sometimes
// errors with "Unspecified error" the very first
time this is set
// (yes, very useful) wrap this with a try/catch block.
doc.onpropertychange = function(){
try {
if ( event.propertyName === 'title' ) {
iframe.document.title = doc.title;
}
} catch(e) {}
};
Closure Compiler raises this error:
jquery.mobile-1.4.5.js:1881: ERROR - variable event is undeclared
if ( event.propertyName === 'title' ) {
^
I suppose Closure is right (as always).
Is this on the radar for the next version?
The following error appears on my website, when I want to show a dialog:
TypeError: undefined is not a function (Chrome)
Error: TypeError: $(...).dialog is not a function (Firefox)
This is due to double including jQuery. The second one is not from my website, but included by the adware WindowShopper in the browser of some visitors. How to prevent this error?