一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

css 兼容性问题this.style.cursor=#39#39hand#39#39

时间:2026-09-14 19:30:01 编辑:袖梨 来源:一聚教程网

css 兼容性问题this.style.cursor='hand'让我们来CSS HACK 作者:洛科先看这一句 复制代码 代码如下:<a href='#' onmouseover="this.style.cursor='hand'" onmouseout="this.style.cursor='default'" onclick="document.getElementById('ShowContent').innerHTML='';return false;"> <img src="UI/clear.gif" style="border:0"/> </a> 在IE下是没问题的,当鼠标划过去时,会出现一个小手的形状,但是在FF中,只有第一次划过去才有效,这个有效是因为有锚记A的存在,而不是onmouseover起作用的结果。 网上找了很多,都说只要让this.style.cursor='hand'改成this.style.cursor='pointer'就可以了,但是在FF中鼠标划过去时只有第一次会出现小手。 其实在FF下面要达到在IE中一样的效果也是可以的。我们的办法就是使用CSS HACK(难道我为CSS HACK又增添了这一条 哈哈?) 复制代码 代码如下:<a href='#' onmouseover="this.style.cursor='pointer';this.style.cursor='hand'" onmouseout="this.style.cursor='default'" onclick="document.getElementById('ShowContent').innerHTML='';return false;"> <img src="UI/clear.gif" style="border:0"/> </a> 在IE7和FF3.0.3中测试通过。

热门栏目