onmouseover和onmouseout在Firefox中不起作用

时间:2011-04-02 23:13:04

标签: javascript css firefox onmouseover onmouseout

我正在尝试使用java脚本函数更改CSS属性,因此此代码在firefox中不起作用/与Safari / Chrome一起使用

<html>
    <head>
        <style type="text/css">
         #hide {
            display: none ;
         }
        </style>
    </head>
    <body>
         <div onmouseover="document.getElementById('hide').style.display = 'compact';" onmouseout="document.getElementById('hide').style.display = 'none';" >
            Move Over Mouse here
         </div>
         <div id="hide"> THIS IS HIDDEN TEXT</div>
    </body>
</html>

任何想法?!

1 个答案:

答案 0 :(得分:2)

尝试显示样式'内联'而不是'紧凑'。