// pure JavaScript var viewportWidth = document.documentElement.clientWidth, viewportHeight = document.documentElement.clientHeight; // jQuery var viewportWidth = $(window).width(), viewportHeight = $(window).height();
// pure JavaScript var viewportWidth = document.documentElement.clientWidth, viewportHeight = document.documentElement.clientHeight; // jQuery var viewportWidth = $(window).width(), viewportHeight = $(window).height();