Live data from Hacker News

Responsive JavaScript

responsivejavascript.com

21–26 of 26 posts

Re: Responsive JavaScript

#21
post #16

Has any work been done on identifying the browsers connection speed so that we may serve high quality vs. low quality assets? The only thing I've been able to find for this is the MaxMind GeoIP Netspeed database, but I have no idea if the data is accurate enough to be valuable. I suppose you could measure latency, but not during the initial page load..

When you have a few hours, Google "responsive images".

Re: Responsive JavaScript

#23

The one problem I've found with this approach is making sure that the CSS and JS breakpoints stay in sync as a site is maintained. At my previous job, we came up with a way of changing JS behavior based on CSS changes to DOM objects. http://blog.cloudfour.com/behavioral-breakpoints/

I don't think it's mentioned in the blog post, but we used csswatch jQuery plugin to watch for changes. https://github.com/leifcr/jquery-csswatch/

Re: Responsive JavaScript

#25
post #19

more 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.…

Some behaviour may need to be initialised depending on the width of the viewport. For example: I may want to provide a side swipe menu in my mobile version that I do not want to initialise and become available in the web version. 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 t…

Why users on tablet with huge screens should be denied Swype menu?

See you are just adding complexity to development and use of the site.

Re: Responsive JavaScript

#26
post #5

Earlier quoted context omitted.

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.

Its more simple than that, imagine I rotate my screen. Do now need to send every possible view port with the original header?

Yeah, suggesting viewport dimensions was a lazily considered and unfortunate choice on my part. Screen dimensions -- probably in particular the larger device width -- would be better, and now that pixel density is an issue, that as well.
Post reply on HN