Posted By

dottDesign on 04/29/10


Tagged

javascript textmate detect


Versions (?)

Screen Resolution Detect


 / Published in: Other
 

Is there a way to make it load just a certain image rather than loading a different page? yep, instead of window.location, you'd use document[imgname].src=imgsrc; instead. just make sure to name your image like this .

  1. <SCRIPT language="JavaScript">
  2. <!--
  3. if ((screen.width>=1024) && (screen.height>=768))
  4. {
  5. window.location="highres.html";
  6. }
  7. else
  8. {
  9. window.location="lowres.html";
  10. }
  11. //-->
  12. </SCRIPT>

Report this snippet  

You need to login to post a comment.