標籤:
html代碼
<img src="../images/account/safe_part_1.png" width="990" height="334" usemap="#safeMap"/>
<map name="safeMap" id="safeMap">
<area shape="rect" coords="4,191,156,233" href="http://www.cadf.org.cn/" target="_blank" />
<area shape="rect" coords="163,191,320,233" href="http://hk.shmzj.gov.cn/" target="_blank"/>
<area shape="rect" coords="322,191,480,233" href="http://www.yintongcard.com/ytcard/zh_CN/index.html" target="_blank"/>
<area shape="rect" coords="4,240,156,282" href="http://cn.unionpay.com/" target="_blank"/>
<area shape="rect" coords="163,240,320,282" href="http://www.chinaums.com/" target="_blank"/>
<area shape="rect" coords="322,240,480,282" href="http://www.chinapay.com/" target="_blank"/>
<area shape="rect" coords="4,291,156,333" href="http://www.cpic.com.cn/cpic/index.shtml" target="_blank"/>
<area shape="rect" coords="164,291,321,333" href="http://www.pingan.com/index.shtml" target="_blank"/>
<area shape="rect" coords="327,291,480,333" href="http://www.spdb.com.cn/" target="_blank"/>
</map>
效果:
問題:
當滑鼠移到map的area上,滑鼠點擊下去時,會有一個藍色的邊框
方案:
在需要去掉邊框的<area>標籤中加入onfocus="blur(this);"
分析:onfocus 事件在對象獲得焦點時發生,那麼blur(this)則是讓當前對象失去焦點。而那個滑鼠按下出現的藍色邊框則是焦點線了。
註:一般為了頁面美觀和效果一致,要去掉這種html標籤內建的效果。但是,通常情況下,盡量不要刻意去除。
若是要在每一個aera上加入,僅用js做一下處理
$(function(){
$.each($("#safeMap area"),function(i,val){
$(val).attr({"onfocus":"blur(this)"});
})
})
html裡,如何去掉點擊map裡area的邊框