Skip to content

Instantly share code, notes, and snippets.

View OlofFredriksson's full-sized avatar
🤠

Olof Fredriksson OlofFredriksson

🤠
View GitHub Profile
/*
*
* Originally inspired by: http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* Original source by https://gist.github.com/highrockmedia/3710930
*
* My contribution: I re-wrote some code it to fire as one function, so you're only editing values in one place.
*
*/
var reflowDocument = function () {
var viewportWidth = jQuery(window).width();
// do stuff here
};
jQuery(document).ready(function($) {
var reflowTimer = null;
$(window).on('resize', function () {