Kullanıcının çözünürlüğüne göre arkaplan renginin değişmesini sağlar.
Kod:<!-- ONE STEP TO INSTALL BG BASED ON SCREEN RESOLUTION: 1. Copy the coding into the HEAD of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Original: Hamid F. Fard ([email protected] ) --> <!-- Web Site: http://www.petanet.com --> <!-- Begin var ScrnSize = "UnCommon" if (navigator.appVersion.indexOf("4.") != -1 && navigator.appName.indexOf("Explorer") != -1) { ScrnSize = screen.width + "x" + screen.height; } if (navigator.appVersion.indexOf("4.") != -1 && navigator.appName.indexOf("Netscape") != -1) { ScrnSize = screen.width + "x" + (screen.height + 19); //Netscape sees 19 pixels less on Height } switch(ScrnSize) { case "640x480": document.write('<body bgcolor="#FF0000" text="#000000">'); case "800x600": document.write('<body bgcolor="#00FF00" text="#000000">'); case "1024x768": document.write('<body bgcolor="#0000FF" text="#000000">'); case "1152x864": document.write('<body bgcolor="#FFFF00" text="#000000">'); case "1280x1024": document.write('<body bgcolor="#AA0000" text="#000000">'); case "1600x1200": document.write('<body bgcolor="#FF00FF" text="#000000">'); case "1600x1280": document.write('<body bgcolor="#00AA00" text="#000000">'); default: document.write('<body bgcolor="#FFFFFF" text="#000000">'); } // The following 3 lines are for display only. They can safely be removed. document.write('Browser Type=' + navigator.appName + '<BR>'); document.write('Browser Version=' + navigator.appVersion + '<BR>'); document.write('Screen Resolution=' + screen.width + "x" + screen.height); // End --> </script> <p><center> <font face="arial, helvetica" size"-2">Free JavaScripts provided<br> by <a href="http://javascriptsource.com">The JavaScript Source</a></font> </center><p> <!-- Script Size: 2.00 KB -->


TUĞGENERAL



Alıntı ile Cevapla
Bu Konuyu Paylaşın !