HJW Posted January 19, 2008 Share Posted January 19, 2008 Hi all,I created the following code in my wpi.html file. Could someone re-write it better? Not all screen resolutions are included. And a 'backup' wallpaper would be nice too...Main reason for this. Wallpapers get out of proportion and if upscaled you have often granular fonts, ugly to read..Thanks in advanceHJW<img id='bgpic' src='' width="100%" height="100%"></div><script type="text/javascript"> if ((screen.width==1920) && (screen.height==1200)) document.all.bgpic.src = "./Themes/vista/wallpaper1920ws.jpg";</script><script type="text/javascript"> if ((screen.width==1600) && (screen.height==1200)) document.all.bgpic.src = "./Themes/vista/wallpaper1600.jpg";</script><script type="text/javascript"> if ((screen.width==1600) && (screen.height==1050)) document.all.bgpic.src = "./Themes/vista/wallpaper1600ws.jpg";</script><script type="text/javascript"> if ((screen.width==1280) && (screen.height==1024)) document.all.bgpic.src = "./Themes/vista/wallpaper1280.jpg";</script><script type="text/javascript"> if ((screen.width==1024) && (screen.height==768)) document.all.bgpic.src = "./Themes/vista/wallpaper.jpg";</script> Link to comment Share on other sites More sharing options...
sp00f Posted January 23, 2008 Share Posted January 23, 2008 Very nice Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted January 23, 2008 Share Posted January 23, 2008 Cool beans looks pretty good.I am going to add like 2-4 widescreen resolutions into the next edition.Which ones might you suggest? Link to comment Share on other sites More sharing options...
zorphnog Posted January 23, 2008 Share Posted January 23, 2008 I created the following code in my wpi.html file. Could someone re-write it better? Not all screen resolutions are included. And a 'backup' wallpaper would be nice too...You need to have a default or as you say 'backup' wallpaper so that the user doesn't have a blank screen if they do not have one of your defined resolutions. Additionally, you can move all of this into one script tag. Here's what I've come up with:<img id='bgpic' src='./Themes/vista/defaultwallpaper.jpg' width="100%" height="100%"></div><script type="text/javascript"> switch(screen.width) { case 1920: if(screen.height==1200) { document.all.bgpic.src = "./Themes/vista/wallpaper1920ws.jpg"; } break; case 1600: if(screen.height==1200)) { document.all.bgpic.src = "./Themes/vista/wallpaper1600.jpg"; } else if(screen.height==1050) { document.all.bgpic.src = "./Themes/vista/wallpaper1600ws.jpg"; } break; case 1280: if(screen.height==1024) { document.all.bgpic.src = "./Themes/vista/wallpaper1280.jpg"; } break; case 1024: if(screen.height==768) { document.all.bgpic.src = "./Themes/vista/wallpaper.jpg"; } break; }</script> Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted January 23, 2008 Share Posted January 23, 2008 Zorphnog you dirty little scripter (Nice job)NICE TO SEE YOU!!!How ya been? Link to comment Share on other sites More sharing options...
zorphnog Posted January 23, 2008 Share Posted January 23, 2008 Whats up Kel!?I'm doing fine. Just trying to catch up on WPI as I've been too busy to keep up with it lately. Looks like you've got everything under control though. Link to comment Share on other sites More sharing options...
HJW Posted January 25, 2008 Author Share Posted January 25, 2008 Zorphnog thanks for your piece of code This will make my WPItheme look good at any screen.HJW Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now