HTML中<area>标签中的光标指针

3

我有一个类似这样的JSP页面

<%@ include file="commonheader.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript">
function passValue(stateid,cityid)
{
if(cityid=="0")
{
    document.forms["test"].action="locator/city.jsp"
    document.forms["test"]["stateid"].value=stateid;
    document.forms["test"].submit();
}
else
{   
    document.forms["test"].action="locator/area.jsp"
    document.forms["test"]["stateid"].value=stateid;
    document.forms["test"]["cityid"].value=cityid;
    document.forms["test"].submit();
}
}
</script>
</head>

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<div align="center">     
<table width="70%" border="0">
<tr>
<td width="80%" align="center"><img src="images/map.jpg" width="550" height="500" border="0" usemap="#Map">
<form id="test" name="test" method="post">
<input type="hidden" name="stateid" />
<input type="hidden" name="cityid"/>       
<map name="Map">
<area shape="rect" coords="81,291,180,305" alt="Maharashtra" onclick="passValue('15','0') />
</map>
</form>
</td>
</tr>
</table>
</div>
</body>
</html>

表单已提交,值已正确传递。但问题在于光标不是指针而是默认的。我甚至尝试在标签中指定style属性,如style="cursor:pointer;",但没有起作用。

2个回答

3

在area标签中添加href="javascript:void(null);"就可以了。


0

我不认为你做错了什么。如果你正在寻找一个快速的解决方案,只需将MAPIMG包装在一个DIV标签中并进行样式设置:

http://jsfiddle.net/8PrD9/

如果您需要更详细的解决方案,本主题可能会有所帮助: 可见区域标签? 参考HTML5规范中的MAP

http://www.w3.org/TR/html5/the-map-element.html

我找不到任何明确说明这些元素不能被样式化的内容,但根据我的研究,这似乎是普遍共识。


谢谢!但我已经尝试过类似这样的代码 <area href="javascript:void(0);" > </area> ,现在它正常工作了... - Hawks

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接