2013-11-21 88 views
0
<img src="demo_usa.png" width="960" height="593" alt="Planets" usemap="#planetmap"> 
     <map name="planetmap"> 
     <area shape="rect" coords="0,0,82,126" alt="Sun" href="#"onmouseover="this.style.backgroundColor='#00FF00';" 
     onmouseout="this.style.backgroundColor='transparent';"/> 
    </map> 

onmouse over friends的問題在哪裏? 我想改變顏色,當鼠標在特亞區域形狀 THX檸多html中的區域形狀

+0

什麼真正幫助將是一個jsfiddle實際圖像可以加載。 –

回答

1

area一種元素只指定了一個圖像的區域,使其可點擊。它沒有爲圖像的那部分設置任何渲染屬性,所以CSS上的設置將被忽略。

若要在鼠標懸停時更改圖片,您需要使用JavaScript代碼替換整個圖片。