Screen Resolution on PageWrites the viewer's screen resolution onto the page.Script CodeGrab a copy of the file below and place it in the same directory as the Web page on which you will use the script (if you wish to place the script file in a different directory you will need to make the necessary adjustments to the src attribute of the script tag that calls it).The code below should be placed between the <body> and </body> tags where you want the text to appear. ExampleA working sample of the script is shown below.
OptionsYou can edit the appearance of the text by adding the screen_res ID to your style sheet and adjusting as desired.You can change the message text itself by editing the line below in the sdetect1.js file. Be careful with the variables on the line. s_span.innerHTML = "Your screen resolution is "+screen.width+"x"+screen.height+" pixles."; AccessibilityA server side script, java applet, or plugin may be able to provide the same information as a backup if necessary. |