Skip to content

Instantly share code, notes, and snippets.

@phiggins42
Created November 13, 2009 22:29
Show Gist options
  • Save phiggins42/234226 to your computer and use it in GitHub Desktop.
Save phiggins42/234226 to your computer and use it in GitHub Desktop.
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