先看这一句

  1. <a href='#' onmouseover="this.style.cursor='hand'" onmouseout="this.style.cursor='default'" onclick="document.getElementById('ShowContent').innerHTML='';return false;">
  2.     <img alt="清空屏幕" src="UI/clear.gif" style="border:0"/>
  3. </a>

在IE下是没问题的,当鼠标划过去时,会出现一个小手的形状,但是在FF中,只有第一次划过去才有效,这个有效是因为有锚记A的存在,而不是onmouseover起作用的结果。

网上找了很多,都说只要让this.style.cursor='hand'改成this.style.cursor='pointer'就可以了,但是在FF中鼠标划过去时只有第一次会出现小手。

 

其实在FF下面要达到在IE中一样的效果也是可以的。我们的办法就是使用CSS HACK(难道我为CSS HACK又增添了这一条 哈哈?)

 

  1. <a href='#' onmouseover="this.style.cursor='pointer';this.style.cursor='hand'" onmouseout="this.style.cursor='default'" onclick="document.getElementById('ShowContent').innerHTML='';return false;">
  2.     <img alt="清空屏幕" src="UI/clear.gif" style="border:0"/>
  3. </a>

如果要在自定义CSS中写:

  1. cursor: pointer;
  2. cursor: hand; 

在IE7和FF3.0.3中测试通过。

 

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐