Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Event to detect when browser(IE) is maximized...

Event to detect when browser(IE) is maximized...

Scheduled Pinned Locked Moved Web Development
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NJdotnetdev
    wrote on last edited by
    #1

    Hi All, I wanted to set height of my table to certain value if IE is maximized. Is there a way to fire such an event? Thanks in advance.

    Kornfeld Eliyahu PeterK A 2 Replies Last reply
    0
    • N NJdotnetdev

      Hi All, I wanted to set height of my table to certain value if IE is maximized. Is there a way to fire such an event? Thanks in advance.

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      Check onresize[^] event... But! I would adwise not to do such thing, but use CSS's height, min-height, max-height to set the table height...

      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      N 1 Reply Last reply
      0
      • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

        Check onresize[^] event... But! I would adwise not to do such thing, but use CSS's height, min-height, max-height to set the table height...

        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

        N Offline
        N Offline
        NJdotnetdev
        wrote on last edited by
        #3

        Thanks, I was trying to do something like this: window.addEventListener("resize",ResizeTable); function ResizeTable() { if((parseInt(screen.height) == parseInt(window.outerHeight)) || (parseInt(screen.height) == parseInt(document.body.clientHeight))) { document.getElementById("table").style.height="91%"; } else { document.getElementById("table").style.height="89%"; } } This code never hits true condition as window.outerHeight & document.body.clientHeight are never equal to screen.height. They are always less that screen.height. Please help.

        1 Reply Last reply
        0
        • N NJdotnetdev

          Hi All, I wanted to set height of my table to certain value if IE is maximized. Is there a way to fire such an event? Thanks in advance.

          A Offline
          A Offline
          Afzaal Ahmad Zeeshan
          wrote on last edited by
          #4

          No, there isn't. Usually, to check whether an application is maximized it to check the windows properties, but IE won't share any of these abstract properties to a web application. In that case, you are only left with an option of window.onresize event. After handling the event, you can manage a guess for the IE's size (in pixels) and change the dimensions of the table depending on the size of viewport. Remember, it is the viewport that you are able to check against. If you (somehow) try to work around with document's dimensions, you may or may not get values biggers than the window or screen itself. That is why, I would still recommend that instead of using JavaScript, you try using CSS3's media queries.

          // default style

          @media screen and (max-width: 300px) {
          // CSS styles when screen is only 300px
          }

          @media screen and (max-width: 500px) {
          // CSS styles when screen is 500px
          }

          @media screen and (min-width: 700) {
          // CSS styles when screen is minimum 500px and no matter how large
          }

          Avoid using JavaScript, as JavaScript costs CPU clocks, thus making it a non-friendly for device's battery, or maybe cause a lagging in your users device. Users may be using mobile.

          The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

          N 1 Reply Last reply
          0
          • A Afzaal Ahmad Zeeshan

            No, there isn't. Usually, to check whether an application is maximized it to check the windows properties, but IE won't share any of these abstract properties to a web application. In that case, you are only left with an option of window.onresize event. After handling the event, you can manage a guess for the IE's size (in pixels) and change the dimensions of the table depending on the size of viewport. Remember, it is the viewport that you are able to check against. If you (somehow) try to work around with document's dimensions, you may or may not get values biggers than the window or screen itself. That is why, I would still recommend that instead of using JavaScript, you try using CSS3's media queries.

            // default style

            @media screen and (max-width: 300px) {
            // CSS styles when screen is only 300px
            }

            @media screen and (max-width: 500px) {
            // CSS styles when screen is 500px
            }

            @media screen and (min-width: 700) {
            // CSS styles when screen is minimum 500px and no matter how large
            }

            Avoid using JavaScript, as JavaScript costs CPU clocks, thus making it a non-friendly for device's battery, or maybe cause a lagging in your users device. Users may be using mobile.

            The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

            N Offline
            N Offline
            NJdotnetdev
            wrote on last edited by
            #5

            Thanks for the suggestions and advise.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups