...

View Full Version : Hideing a column for certain screen resolution?



Verity
11-09-2003, 07:50 PM
Hi,

I have created a site using CSS. It contains three columns with the middle column being adjustable in width. The problem that I have come across is when this site is being viewed with a 800x600 resolution the last column on the right is placed under the middle column so it looks all jumbled together.

Is there a way to hide that column when someone with a screen resolution of 800x600 or lower views the page? But of course the column should stay with the higher resolutions.

Here is the url to the page I'm working on:

http://mywebpages.comcast.net/angelfyre20/test_01.html

The column I'm reffering to is the one with the weather box and picture.

Thanks for any help that may be provided.
Verity

Mr J
11-09-2003, 08:43 PM
Please see the file in the zip.

Verity
11-10-2003, 01:02 AM
Thanks Mr. J.

The only other thing is I also want that picture to disapper as well. If the screen resolution is below 1024.



<script>
function init(){
w=screen.width
if(w!=1024){
document.getElementById("navBeta").style.display="none"
}
}
window.onload=init
</script>


So would I just add another line like this:

document.getElementById("navBetaB").style.display="none"

under the previous one?

Also one other thing, I would like those two elements to show up with the 1152 and 1280 screen resolutions. So would I add more:

if(w!=1152)

and so on??

Thanks for all your help.
Verity

Mr J
11-10-2003, 03:23 PM
Yes, just add

document.getElementById("navBetaB").style.display="none"


They will then only be displayed if the screen resolution is not 800 X 600

Verity
11-11-2003, 03:12 PM
Thank you!

However there is one thing though, when I browse the site at 1280 those two things do not show up. The only resolution they do show up on is 1024.

Mr J
11-11-2003, 03:18 PM
Oops sorry


Change this line

if(w!=1024){


to


if(w<1024){

Verity
11-11-2003, 03:27 PM
Oh, ok. I'll try that then.

Although I applied a fix myself and it seems to be working. I used the else statement but I'll try what you wrote.

Thanks again,
Verity

Verity
11-11-2003, 03:35 PM
Ok, I applied what you wrote and got a syntax error.

But all is ok though, because when I use the else statement it works, and I don't have any syntax errors.

So thanks for helping me get this far, I appreciate it.

Verity

Mr J
11-11-2003, 05:32 PM
If you post a copy of the script as you have it now I should be able to tell you why you get the error



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum