Trying to run a script on the page load, where if a className
is detected it does a Cufon.replace
, effectively overriding any previous Cufon styles.
(very)rough example:
<script type="text/javascript">
window.onload = function() {
if (document.getElementsByTagName('body')[0].className = "highvisTheme"){
Cufon.replace('a.convert-me', { color: '#000' });
}
}
</script>
Go gentle on me. Thanks
You're doing an assignment when you should be doing:
if (document.getElementsByTagName('body')[0].className == "highvisTheme") {
It's pretty common :), the code looks ok otherwise.