SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    do righteous deeds
    Join Date
    Aug 2006
    Location
    Türkiye Turkey تركيى
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    if(charCode == 122) {return false ;}

    main.htm
    Code:
     
    <script type="text/javascript">
    
    function MM_openBrWindow(theURL,winName,features) { 
      window.open(theURL,winName,features);
    }
    
    </script>
    <body>
    
    <a onClick="MM_openBrWindow('popup.htm','','width=500,height=310,toolbar=no,location=no,directories=0,status=no,menuBar=no,scrollBars=no,resizable=no')" href="#">click me</a>
    
    </body>
    popup.htm
    Code:
      
    <script type="text/javascript">
    
    document.onkeypress = function (evt) {
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if(charCode == 122) {return false}
      }
    </script>
    <body>
    This is a test
    </body>
    After popup.htm was opened, user will press to F11 and popup.htm will be fullscreen. I don't want popup.htm is fullscreen. So I write this code:

    document.onkeypress = function (evt) {
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if(charCode == 122) {return false ; }
    }

    With this code, popup.htm is not fullscreen in Firefox and Opera. How to do this on İnternet Explorer?
    popup.htm is fullscreen on İnternet Explorer. Thanks...

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your whole approach seems wrong- let the visitor do what he likes with his browser windows.
    Fighting with the user is never a good strategy.

    If you want more control of the display, use an iframe or document.create a div for your 'popup' content.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,784
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    With the right browser settings your visitors can have all popup windows open full screen to start with so as to not need to press F11.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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