If you are not working with a cell or a tablet you need to use the width of the browser.

01-28-2013, 11:40 PM

eydg

yes, i need it to work with phones too.

media queries - if i understand the linked tutorials - involve several different css'es applied depending on various conditions, like f e screen resolution.

this would greatly complicate future reediting. If possible at all, i would like to stay with js.

it appears to work. thank you.

01-29-2013, 01:14 AM

rnd me

Quote:

Originally Posted by eydg

yes, i need it to work with phones too.

media queries - if i understand the linked tutorials - involve several different css'es applied depending on various conditions, like f e screen resolution.

this would greatly complicate future reediting. If possible at all, i would like to stay with js.

it appears to work. thank you.

my $0.02: i think putting CSS into JS would greatly complicate future reediting. CSS belongs in CSS files, where it controls presentation. JS is for behavior, and behavior, content, and presentation should be kept separate.

all you would need to do is define your small screen class inside a small screen media query.