我想使用MAP,这样每当一个人将光标悬停在图片区域上时,他/她就会自动链接到另一个页面。我似乎无法弄明白。救命! :(
这只是部分代码。代码工作正常。提前谢谢!
document.write('<td> <img src="Ishaharah Plates/p ' + nCount + '.jpg" height="500" width="500" usemap="#green" border="0">');
document.write('<map name="green">');
<script>
function AutoLink(sLink){document.housec.src = sLink}
</script>
if(parseInt(nxCount)==16)
document.write('<area shape="rect" onmouseover="ShowPic(this.href)" coords="375,190,450,240" href="Plate_19_1.php?XCount=' + nxCount + '&Number=1&Count=' + nCount + '&Correct=' + nCorrect + '">');
if(parseInt(nxCount)==15)
document.write('<area shape="rect" coords="335,210,385,265" href="Plate_' + nCount + '_1.php?XCount=' + nxCount + '&Number=' + nAnswer + '&Count=' + nCount + '&Correct=' + nCorrect + '">');
答案 0 :(得分:0)
假设您在区域标记上设置了href,请尝试onmouseover =“window.location.href = this.href”
如果您隔离了问题并发布了一个完整的示例,那么帮助您会更容易。