zurb/foundation — pull request #4061 by cereallarceny (2014-01-03 22:05:06+00:00)
Title: Javascript media queries

This solution relies on CSS to change the ```z-index``` of an element, rather than force the user to constantly compare against the window's width. By using CSS media queries as our point of change, rather than jQuery selectors, we can more quickly determine a change in a media query from the Javascript side. Here's an example I propose:

$(window).resize(function() {
var query = $('body').attr('data-mediaquery');

if(query == "small")
// Small layout
else if(query == "medium")
// Medium layout
else if(query == "large")
// Large layout
else if(query == "xlarge")
// XLarge layout
else
// XXLarge layout
});