2
如何使每個元素的svg圖像嵌入HTML文件中(比如用某種類的圓等)一個活動鏈接? 我需要一個代表一些元素的svg圖像,它們應該是可點擊的鏈接。如何使SVG元素成爲鏈接?
這是SVG圖像的片段:
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="612px" height="792px" viewBox="0 0 612 792" enable-background="new 0 0 612 792" xml:space="preserve">
<a href="http://google.com" ><rect x="-124.203" y="112.232" fill="#E88324" stroke="#000000" stroke-miterlimit="10" width="175.362" height="226.087"/> </a>
我做了第二次DIV:
<div class="displayer" style=" width:100%; height: 100%;">
</div>
並試圖做到這一點使用jQuery:
$(document).ready(function() {
$("a").click(function() {
// $("body").hide();
$(".displayer").load("http://google.com");
});
});
但它不」沒有道理,你會怎麼做?
你並不需要聲明的HTML裏面的SVG所有的命名空間。 – Shikkediel