Created
August 31, 2010 17:52
-
-
Save irae/559425 to your computer and use it in GitHub Desktop.
This file contains 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
<script type="text/javascript"> | |
(function(){ | |
// Fix IE problem with many span inside an <a> and fix hovering | |
if(document.body.attachEvent){ | |
function findLink(elm) { | |
if(elm.nodeName.toLowerCase() == "a") { | |
return elm; | |
} else { | |
return findLink(elm.parentNode); | |
} | |
} | |
function blocoTopsEnter() { | |
var a = findLink(window.event.srcElement); | |
a.className += ' over'; | |
}; | |
function blocoTopsLeave() { | |
var a = findLink(window.event.srcElement); | |
a.className = a.className.replace(/ ?over/g,''); | |
}; | |
function blocoTopsClick() { | |
var a = findLink(window.event.srcElement); | |
document.location.href = a.href; | |
}; | |
var as = document.getElementById('novaColDireita').getElementsByTagName('a'); | |
for(var i=0;i<as.length;i++) { | |
as[i].attachEvent("onmouseenter", blocoTopsEnter); | |
as[i].attachEvent("onmouseleave", blocoTopsLeave); | |
as[i].attachEvent("onclick", blocoTopsClick); | |
} | |
} | |
})() | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment