JSFiddle

  • Responsive JavaScript #35 is the latest revision

    Uses JavaScript to set the body class. From this simple very short script you can build your entire site to be responsive using only CSS.

    resizeWindow = function () {
        var body = document.getElementsByTagName('main')[0];
        var w = window.innerWidth;
        if (w < 720) {
            body.className = "small";
        } else {
            if (w > 720 && w < 1024) {
                body.className = "normal";
            } else {
                if (w > 1024) {
                    body ...