Skip to content

Commit

Permalink
Adding cookie for screen size
Browse files Browse the repository at this point in the history
Adding cookies for screen width and height. Renaming window width and height cookies to be what they mean.

Signed-off-by: thebestsophist <bernardy@enguin.com>
  • Loading branch information
thebestsophist committed Mar 7, 2012
1 parent 2b0cab0 commit fdd6b71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/plugin.js
@@ -1,6 +1,8 @@
// This requires jQuery to function properly
// Sets window properties as cookies for server-side optimizations
$(window).resize(function () {
document.cookie = "screen-height=" + $(window).height() + "; path=/";
document.cookie = "screen-width=" + $(window).width() + "; path=/";
document.cookie = "window-width=" + $(window).width() + "; path=/";
document.cookie = "window-height=" + $(window).height() + "; path=/";
document.cookie = "screen-width=" + screen.width + "; path=/";
document.cookie = "screen-height" + screen.height + "; path=/";
});

0 comments on commit fdd6b71

Please sign in to comment.