I need to disable the browser menu bar for a web page and, from what I read, I need open this page in a pop-up page using "window.open..." and disable the menubar for this one.
The problem is that I do this on document ready and the "window.open..." statement will loop to infinite and will open "infinite" pages.
Here is a sample:
<script language="javascript" type="text/javascript">
$(document).ready(function() {
popupWindow(document.URL);
$('body').attr('oncontextmenu','return false;');
$('a').click(function(event) {
if (isCtrlKeyPressed(event.type)) {
event.preventDefault();
}
});
});
function popupWindow(url) {
var newwindow;
newwindow = window.open(url, window.name, 'directories = no, toolbar = no, menubar = no, resizable = no, scrollbars = no, status = no, width=' + screen.width + ', height=' + screen.height + '');
newwindow.moveTo(0, 0);
if (window.focus) {newwindow.focus()}
}
function isCtrlKeyPressed(evt) {
var ctrlMod = (window.event)? window.event.ctrlKey : evt.ctrlKey;
return ctrlMod;
};
</script>
I need an idea to control this... open just one page...
Maybe if I put an "if" for the pop-up page to check if the pop-up page already have menubar disabled this will do?!
Thanks in advance!
This post has been edited by X-spert: 12 July 2012 - 05:51 AM

New Topic/Question
Reply


MultiQuote





|