Created
July 25, 2010 06:02
-
-
Save scottdavis/489349 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ie8hack() { | |
| $(window).unload(function(){ | |
| ie8unload(); | |
| }); | |
| $(function(){ | |
| ie8load(); | |
| }) | |
| } | |
| function ie8load() { | |
| var today = new Date(); | |
| var now = today.getUTCSeconds(); | |
| var name = 'refresh'; | |
| if($.cookie(name) !== null) { | |
| var cookieArray = $.cookie(name).split(';'); | |
| var time = cookieArray[0]; | |
| var loc = cookieArray[1]; | |
| if(loc == escape(window.location) && Math.abs(now - time) < 5 ) { | |
| var oldY = document.documentElement.clientHeight; | |
| var oldX = document.documentElement.clientWidth; | |
| window.resizeTo(oldX, oldY); | |
| var padX = oldX - document.documentElement.clientWidth; | |
| var padY = oldY - document.documentElement.clientHeight; | |
| window.resizeTo(oldX + padX, oldY + padY); | |
| } | |
| $.cookie(name, null); | |
| } | |
| } | |
| function ie8unload() { | |
| var today = new Date(); | |
| var now = today.getUTCSeconds(); | |
| $.cookie('refresh', now + ';' + escape(window.location)) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /[if IE 8] | |
| = javascript_tag("ie8hack();") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment