Created
November 13, 2009 22:29
-
-
Save phiggins42/234226 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
dojo.ready(function() { | |
/* | |
Emulate IE-6 rendering | |
original: http://mankzblog.wordpress.com/2009/11/13/ie6-frame-to-battle-chrome-frame/ | |
@param node, the poor node to get "the treatment" | |
*/ | |
// dear LORD, please DRY | |
var jank = [ | |
{ styleFloat:"left" }, | |
{ marginLeft,"10px" }, | |
{ width:"102%" }, | |
{ height:"110%" }, | |
{ position:"absolute" }, | |
{ display:"inline" }, | |
{ color:"#fff" } | |
]; | |
// here, fixed that for ya | |
function ie6ize(node){ | |
dojo.style(node, jank[Math.floor(Math.random() * jank.length)]); | |
} | |
// yay, pass a function reference. | |
dojo.query('body *').forEach(ie6ize); | |
// oh, make it a plugin too | |
dojo.NodeList.prototype.ie6ize = dojo.NodeList._adaptAsForEach(ie6ize); | |
dojo.query(".foo").ie6ize(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment