Skip to content

Instantly share code, notes, and snippets.

@james-andrewsmith
Created April 13, 2011 01:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james-andrewsmith/916805 to your computer and use it in GitHub Desktop.
Save james-andrewsmith/916805 to your computer and use it in GitHub Desktop.
An example fix for cufon lazy loading issues with IE6,7,8
<!doctype html>
<html lang="en">
<head>
<title>Cufon IE6,7,8 Lazy Loading</title>
<script type="text/javascript" src="script/head.js"></script>
<script type="text/javascript">
if (head.browser.mozilla || head.browser.webkit || head.browser.opera ||
(head.browser.ie && (head.browser.version == '9.0'))) {
head.js('script/jquery.min.js',
'script/cufon.js', function () {
head.js('script/bebas_neue_400.font.js', function () {
Cufon.replace('h1', {
textShadow: '1px 1px rgba(0, 0, 0, 0.2)'
}).now();
});
});
} else {
// here we load scripts depending on GZIP support for this browser
document.write('\x3Cscript type="text/javascript" src="script/jquery.min.js">\x3C/script>');
document.write('\x3Cscript type="text/javascript" src="script/cufon.js">\x3C/script>');
document.write('\x3Cscript type="text/javascript" src="script/bebas_neue_400.font.js">\x3C/script>');
document.write('\x3Cscript type="text/javascript" src="script/file.with.cufon.replacement.js">\x3C/script>');
}
</script>
<style type="text/css">
h1
{
font-family:'Bebas Neue';color:#1b1b1b;font-size:96px;
}
</style>
</head>
<body>
<h1>THIS IS A TEST</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment