Technology computers-hardware

How to Measure a Website in Pixels

    • 1). Launch your HTML editor and open a Web page document.

    • 2). Add the following "<script>" section after your document's opening "<head>" tag:

      <script type="text/javascript">

      </script>

    • 3). Paste the following JavaScript code after the opening "<script>" tag:

      <script type="text/javascript">

      window.onload=function() {

      getPixels();

      }

      function getPixels() {

      var pixelWidth = screen.width;

      var pixelHeight = screen.height;

      var pageSize = "Page Width = " + pixelWidth + " .. Page Height = " + pixelHeight;

      alert(pageSize);

      return pageSize;

      }

      </script>

      The "window.unload" function calls a function named "getPixels" when a browser loads the page. The "getPixels" function, shown after the "window.onload" function, retrieves the page's dimensions by checking the "screen.width" and "screen.height" properties. Those properties contains the dimensions of the user's entire screen. The function then displays a pop-up alert window showing you those dimensions.

    • 4). Save the HTML document and open it in a browser. The getPixels function runs and displays the page's size in pixels.

Related posts "Technology : computers-hardware"

Innovative And Economical Vxa Tape Technology

Hardware

How to Save a Document to a Flash Drive From Open Office

Hardware

NAS vs DAS, Which Is Better And Why?

Hardware

How to Flash BIOS on a Acer Aspire 5517 Laptop

Hardware

Jet Tec Canon Pg510 And Cl511 Ink Cartridges From Uk Ink Supplies

Hardware

How do I Hook Up My 3M X55i Projector to My Computer?

Hardware

How to Conduct Remote Management of an HP Laserjet 4050

Hardware

How to Copy Games to a Hard Drive

Hardware

How to Hide Windows System Tray Icons

Hardware

Leave a Comment