[thelist] loading a graphic dependant on user resolution

Anthony Baratta Anthony at Baratta.com
Tue Feb 13 20:14:17 CST 2001


At 11:41 AM 2/13/2001 -0600, you wrote:
>for your consideration:
>
>http://www.bayou.com
>
>And the question is:  Is there a way to make the graphic under current 
>events not load if a user is running 640x480?
>My theory:  A small javascript that detects the screen size and if it is 
>lower than a certain size load an transparent gif and if above that same 
>certain size load the image that's there now.  I know some javascript but 
>I'm unsure as to how to proceed on this.

Your on the right track...You can use the screen.availWidth "function" in 
Javascript to assess the size of the screen and if less that 700, drop in 
your gif. You could put the script right were you want the graphic to 
appear and "write" the appropriate code to the browser OR put the script at 
the end of your page and treat the image like a rollover, only instead of a 
click event - just immediately activate the javascript.



---
Anthony Baratta
President
Keyboard Jockeys





More information about the thelist mailing list