JavaScript Source Code 3000: User Details: Resolution Page
Resolution Page
When users visit your page, JavaScript will determine their screen's resolution and redirect them to the page of your site that you wrote for that screen size!
JavaScript Source Code 3000: User Details: Resolution Page
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as NotePad or SimpleText) and save (Control-s or Apple-s). The script is yours!
<!-- THREE STEPS TO INSTALL RESOLUTION PAGE:
1. Paste the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document
3. Be sure to update the resolution pages to ones on your site -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<! >
<! >
<!-- Begin
function redirectPage() {
var url640x480 = "http://www.yoursite.com/640x480";
var url800x600 = "http://www.yoursite.com/800x600";
var url1024x768 = "http://www.yoursite.com/1024x768";
if ((screen.width == 640) && (screen.height == 480))
window.location.href= url640x480;
else if ((screen.width == 800) && (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) && (screen.height == 768))
window.location.href= url1024x768;
else window.location.href= url640x480;
}
// End -->
</script>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<center>
<form>
<input type=button value="Enter!" onClick="redirectPage()">
</form>
</center>
<!-- STEP THREE: Don't forget to update the URLs in the code above! -->
<!-- Script Size: 1.29 KB -->
Wyszukiwarka
Podobne podstrony:
page$resolution05page&install product pagepage36page 1page 8page3les09 page handling tmpage2page&7new pagepage 1więcej podobnych podstron