Skip to content

Instantly share code, notes, and snippets.

View apacsa's full-sized avatar

apacsa apacsa

  • Novi Sad, Serbia
View GitHub Profile
@apacsa
apacsa / js-cssloader
Last active August 29, 2015 14:22
This JS code checks the width of the browser window, and loads the according stylesheet variant. Stylesheet variants are differentiated by a two-letter suffix (-tn, -xs, -sm, -md, -lg, -xl, -xx). These are standard Bootstrap screen-sizes, with some extensions added from: https://github.com/webprom/bootstrap-layout-xl-xxl/blob/master/bootstrap-xl…
/*
* author: arpad1976@gmail.com
* 2015-06-02
*/
var windowWidth = window.innerWidth;
var windowWidth = window.innerWidth;
if (windowWidth >= 1920) {
styleSheetVariant = '-xx';
} else if (windowWidth >= 1440 && windowWidth < 1920) {
styleSheetVariant = '-xl';