<STYLE>
.vis1 { visibility:visible }
.vis2 { visibility:hidden }
</STYLE>
</HEAD>
<BODY>
<IMG ID="oSphere" SRC="sphere.jpg">
<P onmouseover="oSphere.className='vis2'"
onmouseout="oSphere.className='vis1'">
Move the mouse over this text to make the sphere
disappear.</P>
这是DHTML里visibility属性的实例代码.
我把图片放进去已经可以显示了,可是将鼠标移动上去和移开没有效果.然后我试着把赋值语句oSphere.className='vis1'封装在函数里,onmouseout=调用函数就可以执行了,这是为什么?是不是现在的浏览器不支持这种事件监听=执行语句的句式了.
而且文档里面直接点击show me会出现脚本错误提示.