Computing.Net > Forums > Programming > CSS, resolution

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

CSS, resolution

Reply to Message Icon

Original Message
Name: abc123456789
Date: December 15, 2003 at 18:26:58 Pacific
Subject: CSS, resolution
OS: win 2000 pro
CPU/Ram: AMD k6II 450mhz 128mb
Comment:

Is there anyway i can use javascript to determine a users screen resolution and load a .css file for that specific resolution, i hope i make sense thanks alot


Report Offensive Message For Removal


Response Number 1
Name: SN
Date: December 15, 2003 at 18:49:41 Pacific
Reply:

I've never done it, but it seems like it could be done. Check out the following links for various parts to the project:

http://www.alistapart.com/articles/alternate/ - Has a function that shows you how to switch stylesheets (basically you link to them all, then use a javascript to disable the ones you don't want.)

http://www.computing.net/programming/wwwboard/forum/8726.html shows how to detect screen sizes in js

http://www.codelifter.com/main/javascript/changestyles.html - another example of how to change stylesheets on the fly

If you're javascript savvy, then the above should give you enough info to put it all together. If not, you'll have to wait for somebody else or until after my finals are over:-)

Good luck,
-SN


Report Offensive Follow Up For Removal

Response Number 2
Name: anonproxy
Date: December 15, 2003 at 19:47:01 Pacific
Reply:

Come on, you can use Google. Try this.


Report Offensive Follow Up For Removal

Response Number 3
Name: abc123456789
Date: December 15, 2003 at 19:52:39 Pacific
Reply:

SN and anonproxy, thanks for the links i should be able to figure it from here :)
once agian thanks for the help


Report Offensive Follow Up For Removal

Response Number 4
Name: raylu
Date: December 31, 2003 at 11:49:19 Pacific
Reply:

screen.width and screen.height would give you the screen's width and height.

Then you could do
if (screen.width == 800 && screen.height==600) {
//something here, although I'm not sure what
}

I don't know how to load a CSS file in JavaScript.


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home



Results for: CSS, resolution

Code Builder in Access2000
    Summary: Thanks Mark for your reply. But you seem not understand my point. What I need is to send emails from the access itself to others outlooks not the opposite. This is what my colleague wrote in the code...
www.computing.net/answers/programming/code-builder-in-access2000/3104.html

DOS Variable Help
    Summary: Hello Everybody! I need some help to figure out this: i have a .net email applicaction that runs from command prompt, and it attaches a txt file to the email and sends it. You pass the from, to, subje...
www.computing.net/answers/programming/dos-variable-help/15529.html

can we send mails from a table in access
    Summary: Hello If you have not yet received an answer to your mail question the following code works well to call the module use the following syntax from your form gvarToRecipient = "Joe Bloggs" g...
www.computing.net/answers/programming/can-we-send-mails-from-a-table-in-access/773.html








Which MP3 player do you have?

iPod/iPhone
Zune
Something Else
None


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History






Data Recovery Software