0

我为 FF 编写扩展,这部分代码不适用于早期版本 6.0-8.0。但是在 12.0-13.0 版本上,一切都很好。是什么原因?

        for(var i = 0; i < doc.getElementsByClassName('repInfo').length; i++)
        {
            doc.getElementsByClassName('repInfo')[i].getElementsByTagName('a')[0].style.visibility = "hidden";
            doc.getElementsByClassName('repInfo')[i].getElementsByTagName('a')[1].style.visibility = "hidden";

            doc.getElementsByClassName('repInfo')[i].addEventListener('mouseleave', 
                function(e) {
                    e.target.getElementsByTagName('a')[0].style.visibility = "hidden";
                    e.target.getElementsByTagName('a')[1].style.visibility = "hidden";
                }, false);
            doc.getElementsByClassName('repInfo')[i].addEventListener('mouseenter', 
                function(e) { 
                    e.target.getElementsByTagName('a')[0].style.visibility = "visible";
                    e.target.getElementsByTagName('a')[1].style.visibility = "visible";
                }, false);
        }
4

1 回答 1

2

mouseentermouseleaveFirefox 10 添加了支持。

于 2012-06-08T18:52:24.700 回答