Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Template depending on screen resolution

Template depending on screen resolution

Locked

Views: 2,603

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
17 Oct 2006, 8:51 AM
#1
mat123slade avatar

mat123slade

Zen Follower

Join Date:
Nov 2005
Location:
France - Limoges
Posts:
90
Plugin Contributions:
0

Template depending on screen resolution

Hi, is it possible to display a specific template depending on the screen resolution. I have a special template for WideScreens that I would like people to be able to use without selecting a template from a selection box...

Thanx in advance for any advice.

17 Oct 2006, 1:52 PM
#2
mat123slade avatar

mat123slade

Zen Follower

Join Date:
Nov 2005
Location:
France - Limoges
Posts:
90
Plugin Contributions:
0

Re: Template depending on screen resolution

Ok, I have found a way around this, that I really appreciate. It's not good to use this kind of method too often as it really isn't recommended for SEO.

I use it to hide or display certain graphic elements depending on screen resolution. I tend to like a centered website wich isn't too wide, so on both sides of the website, I like to add logos + other info, that isn't vital, but that kind of stops the screen from looking too empty. Here is an example : http://www.netjuggler.net/index.php (note you will only see the difference in 1280 +. It works on a resize + reload of page as the javascript is based on page width.

<html> <head> </head> <body> <div id="para">Some text here</p> <script type="text/javascript"> if(document.width<1280) { elem = document.getElementById("para").style.display = 'none'; } </script> </body> </html>

Note it is important that the javascript is placed right at the bottom of the page...

PS : I'm still looking for a way of changing template depending on screen resolution to try and optimize the website display depending on resolution used.