在我看來,更優雅的解決方案是使用CSS3動畫,而不是jQuery的(see Tinkerbin):
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="956px" height="745px" >
<style type="text/css">
a > image {
opacity: 0;
pointer-events:none;
transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
-webkit-transition: opacity .25s ease-in-out;
}
a > polygon {
opacity:0;
}
a:hover > image {
pointer-events:auto;
display:inline;
opacity: 1;
}
</style>
<image x="0" y="0" width="956" height="745" xlink:href="http://www.kollegetown.com/themes/kollegetown/images/img1.jpg" />
<!-- stadium/team -->
<a xlink:href="/team" target="new">
<image id="team" x="63" y="284" width="204" height="365" xlink:href="http://www.kollegetown.com/themes/kollegetown/images/homeRollover_team.jpg"/>
<polygon points="189 383, 185 345, 155 316, 209 281, 211 244, 289 210, 291 241, 348 245, 397 290, 391 299, 344 276, 345 369, 365 385, 330 404, 313 438"/>
</a>
<!-- corporate -->
<a xlink:href="/corporate" target="new">
<image id="corp" x="33" y="29" width="356" height="221" xlink:href="http://www.kollegetown.com/themes/kollegetown/images/homeRollover_corporate.jpg"/>
<polygon points="18 126, 86 125, 186 180, 190 271, 99 327, 31 330, 18 321"/>
</a>
<!-- campus shops -->
<a xlink:href="/campusbooster" target="new">
<image id="shops" x="423" y="186" width="497" height="213" xlink:href="http://www.kollegetown.com/themes/kollegetown/images/homeRollover_shops.jpg"/>
<polygon points="425 60, 427 209, 470 226, 469 246, 483 251, 506 235, 534 244, 595 214, 600 191, 612 188, 621 201, 633 196, 631 23, 624 17, 504 17"/>
</a>
<!-- art gallery/design -->
<a xlink:href="/designs" target="new">
<image id="design" x="496" y="407" width="331" height="321" xlink:href="http://www.kollegetown.com/themes/kollegetown/images/homeRollover_gallery.jpg"/>
<polygon points="503 509, 438 547, 440 691, 481 710, 482 729, 647 729, 647 582"/>
</a>
</svg>
沒有與歌劇毛刺,它不會使鼠標事件過於圖像敏感懸停。但用戶仍然可以點擊該建築物來關注該鏈接。無法測試IE9(我的Win7筆記本出現問題)。
self.jQuery在鉻中工作 – philipp