Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jpg changing depending screen resolution

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi. I want to know for my html page if javascript could show a specefic jpg depending of the screen resolution and if yes how.
Ex. would see a jpg with a width of 640 on a 640x480 screen or a 800 width jpg on a 800x600 screen resolution.
 
Should be able to adapt this ... it was designed to view different screens dependent upon screen resolution ...

<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor=&quot;#FFFFFF&quot;>
<SCRIPT language=&quot;JavaScript&quot;>
<!--
if ((screen.width ==544) && (screen.height == 376)) { window.location=&quot;R1.HTM&quot; }
if ((screen.width ==640) && (screen.height == 480)) { window.location=&quot;R2.HTM&quot; }
if ((screen.width ==720) && (screen.height == 512)) { window.location=&quot;R3.HTM&quot; }
if ((screen.width ==800) && (screen.height == 600)) { window.location=&quot;R4.HTM&quot; }
if ((screen.width ==1024) && (screen.height == 768)) { window.location=&quot;R5.HTM&quot; }
if ((screen.width ==1152) && (screen.height == 864)) { window.location=&quot;R6.HTM&quot; }
if ((screen.width ==1280) && (screen.height == 1024)) { window.location=&quot;R7.HTM&quot; }
if ((screen.width ==1600) && (screen.height == 1200)) { window.location=&quot;R8.HTM&quot; }
if ((screen.width ==1920) && (screen.height == 1200)) { window.location=&quot;R9.HTM&quot; }
//-->
</SCRIPT>
</BODY>

Zot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top