0

Ok guys, this is a tricky one... Pay close attention!

  1. I have a website with 2 pages index.html & about.html.
  2. I built these pages to work at all screen resolutions 1024x768 and higher.
  3. Before the cliche "make it scale-able with percentages not pixels in the css" I did to some degree but the lowest resolution it works well at is 1024x768 because it is my graphic design portfolio (I feel justice won't be served at any resolution lower than that!)
  4. I also have a missing.html page in the directory in-case someone follows a bad link!
  5. I was wondering is it possible to make a "I'm sorry this page only displays in resolutions of 1024x768 and higher!" page to pop-up when someone with a lower resolution tries to go to both the index and about pages? 6 I was thinking along the lines of the IE CSS conditional element but not for browsers just for resolutions. (a conditional statement to spawn new page due to low resolution!)
  6. I just want a new .html page to spawn for people with resolutions under 1024x768 (I know the website would need some kind of detection but no idea how to implement it!)
  7. I apologize for being so anal-retentive and numbering my issue the way I did, any help would be greatly appreciated! Elaborate as much as possible!
1
  • Anal retentiveness is not a problem for developers like us. By the way, with filenames like that, it's most likely not real XHTML. Commented Apr 26, 2013 at 11:06

3 Answers 3

4

You can use CSS media queries, such as:

@media (max-width: 1024px) { ... }

Inside your pixel-specific query you can make a div, with the "I'm sorry..." message, visible.

Bear in mind that getting the monitor size via generic JavaScript might not reflect the size of the actual browser window - media queries will.

Sign up to request clarification or add additional context in comments.

Comments

1

Well, you can detect screen resolution with javascript!

var width = window.innerWidth || document.body.clientWidth;
var height = window.innerHeight || document.body.clientHeight;

if(width < 1024 || height < 768) {
    // screen is too small, redirect to small.html
    location.href = 'small.html';
}

1 Comment

Joe R gave you a modern solution also!
0

So would the css query or js work better? I am going for the most responsive, fluid, functional ui/ux build that I can! Whichever targets better, most quickly implemented, etc! Would using both cause conflictions?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.