Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts

    How to disable fullscreen on a popup wondow?

    Hey, can anyone give me a hint how do I disable fullscreen button/possibility on a popup window?

    I have a code like this:
    Code:
    <script type=text/javascript>
    <!--
    var win= null;
    function NewWindow(mypage,myname,w,h,scroll){
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    var settings ='height='+h+',';
    settings +='width='+w+',';
    settings +='top='+wint+',';
    settings +='left='+winl+',';
    settings +='scrollbars='+scroll+',';
    settings +='resizable=no';
    win=window.open(mypage,myname,settings);
    if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
    }
    
    function MM_openBrWindow(theURL,winName,features) {
    window.open(theURL,winName,features);
    }
    //-->
    </script>
    and it is called like this:
    Code:
    <a href="popup.html" onClick="NewWindow(this.href,'name','600','300','yes');return false">Click here</a>

    I tried adding settings +='fullscreen=no'; in the script after resizable=no, but it didn't hep. Is it even possible?
    Last edited by krispol; 06-12-2012 at 12:41 PM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    You can't, for accessibility reasons.

    Read https://developer.mozilla.org/en/DOM...ality_features
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    krispol (06-12-2012)

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Ok, thanks for letting me know that.

  • #4
    Regular Coder
    Join Date
    Jun 2012
    Location
    Near Chicago, USA
    Posts
    123
    Thanks
    7
    Thanked 19 Times in 19 Posts
    I am a person for whom "can't" is an incentive to do it anyway

    The viewing area of the browser window can be measured. The popup height and width variable values can be adjusted accordingly before the popup is displayed.

    [Edit. Sorry. Misread the original post.

    Haven't tried this, but onresize() might be utilized to determine when the popup window is resized and do whatever is appropriate to respond to the event.]

    Will
    Last edited by Will Bontrager; 06-12-2012 at 02:52 PM. Reason: additional info

  • Users who have thanked Will Bontrager for this post:

    krispol (06-12-2012)

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You can't "disable" anything with JavaScript - anything you try to disable that way can be easily bypassed. At worst the person will turn off JavaScript on your page if there isn't a browser setting to ignore whatever you are trying to do.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    New Coder
    Join Date
    Jun 2012
    Location
    MI
    Posts
    11
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Is this what you want to do:
    Code:
    var IE = (document.all) ? 1 : 0;
    var DOM = 0;
    if (parseInt(navigator.appVersion) >=5) {DOM=1};
    
    function keyDown(evt) {
        if (DOM) {
                if (evt.which == 122) {
                    evt.which = 0;
                    return false;
            }
        } else {
                if (event.keyCode == 122) {
                    event.keyCode = 0;
                    return false;
            }
        }
    }
    or this:
    Code:
    <SCRIPT LANGUAGE=javascript>
    <!--
    document.onkeydown = function ()
    {
        if (122 == event.keyCode)
        {
            event.keyCode = 0;
            return false;
        }
    }
    will make return of full screen (false.)

  • #7
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Hei bundled

    Unfortunately these codes didn't do anything for some reason, I was still able to press maximize button on my pop up window


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •