Responsive JavaScript
11–20 of 26 posts
Re: Responsive JavaScript
#12Nice resource. It would be cool if the author added links to the libraries that are being referenced.
Re: Responsive JavaScript
#13Re: Responsive JavaScript
#14I can see the appeal, but I wonder if this might not be better accomplished with an HTTP header that would explicitly give the viewport dimensions and/or some information about the connection type/speed.
Viewports can change in size once the page has loaded. A Connection-Quality: GPRS, 512kbps; header would be nice. But then you still get an issue when phones must report or the user toggles on WiFi as soon as they see a few bad (low bitrate) assets.
Do now need to send every possible view port with the original header?
Re: Responsive JavaScript
#15I can see the appeal, but I wonder if this might not be better accomplished with an HTTP header that would explicitly give the viewport dimensions and/or some information about the connection type/speed.
Re: Responsive JavaScript
#16Re: Responsive JavaScript
#17Re: Responsive JavaScript
#18I really like Jeremy Keith's approach to "responsive javascript". He uses `:after` and updates the content property based on media queries. It keeps it nice and DRY. Here's a small demo: http://jsbin.com/meqon/2/edit?css,js,output
Edit: How he got there is a neat, quick read for anyone interested: http://adactio.com/journal/5429/
Re: Responsive JavaScript
#19why on earth have javascript to do CSS's work?
and why do you care about screen size changes? the only good thing it does is hint you about device orientation. But who says when i change from portrait to landscape i want a whole new site? sometimes turning a device just mean i want to fit one image better in the screen. not change all my navigation elements to fit the designer dream of multi-screen shenanigans.
yeah, i sound like the old fart who don't like shinny things and change. but people impressed by this sound like the kids adding animated gif after animated gif to their geocities page. now get off my lawn!
Re: Responsive JavaScript
#20more things that take the control out of the user. and add lots of complexity for no good reason. why on earth have javascript to do CSS's work? and why do you care about screen size changes? the only good thing it does is hint you about device orientation. But who says when i change from portrait to landscape i want a whole new site? sometimes turning a device just mean i want to fit one image better in the screen.…
Yes, you don't need a whole new site. But I as a developer may want to provide a better experience with the additional horizontal space I just received in the landscape mode. Or I may want to sneak in some ads on the side.
Media queries go only so far but they cannot help you to create behaviour that depends on the width of the viewport.