我正在使用jQuery和jQuery Mobile来创建一个包含多个元素的地图。这些元素应该代表建筑物或建筑物的一部分。如果你点击它们,你应该到另一个页面或打开一个对话框。SVG中的链接与jquery mobile不起作用
最好的解决方案是将SVG代码放入页面,因为它是可缩放的。现在的问题是路径周围的链接不起作用。它们显示在每个浏览器中,甚至显示目标链接,但它什么也没有发生。如果我评论jquery mobile 1.4.5的嵌入,并且它只适用于jquery!
SVG中的示例路径的代码示例。它显示了一个带有维基百科链接的红色正方形。在jQuery中运行,但不与jQuery Mobile的:
<div data-role="content">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 525 365"
xmlns:xlink="http://www.w3.org/1999/xlink" id="map" preserveAspectRatio="xMinYMin meet">
<a xlink:href="//en.wikipedia.org/wiki/Main_Page">
<path
style="fill:#ff2700;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-
linejoin:miter;stroke-opacity:1;fill-opacity:1"
d="M 24.243661,19.27897 230.31478,11.197749 222.23356,223.32978 18.182746,235.45161 z"
id="path3773"
inkscape:connector-curvature="0"
transform="translate(216.65625,143.28125)" />
</a>
</svg>
</div>