2011-12-10 19 views
2

我在我的網站上使用Raphael.js。請在標題中看看徽標。 http://hooche.ru/md2 代碼標誌:如何到<href..>我的svg-logo和Raphael?

<script type="text/javascript"> 
    window.onload = function() {  
    var r = Raphael(logo); r.attr({href: "http://google.com/", target: "blank"}); 
     other vector.. 
     ... 
</script> 

和標誌^

<div id="logo"></div> 

但現在的HTML代碼,我們有:1個字母= 1個谷歌鏈接=非常多谷歌的鏈接和空,不可點擊空格在一個svg標誌周圍的字母。

怎麼做:1 SVG-標誌= 1個鏈接到某個地方,沒有空的空間, 例如,DIV標誌有:

width: 190px; 
height: 67px; 

回答

0

的鏈接替換您的div,那麼你就不需要r.attr()位。

<a id="logo" href="http://google.com/"></a> 

(我不會建議使用target="_blank"那裏。這不是標準的行爲,讓最終用戶選擇)。

0

我想我明白這是爲什麼。我不得不做這樣的事情:

<a id="logo" xlink:href="o-nas.php" title=""></a> 

的XLink

我的文檔中讀取。

+0

)))但現在鏈接不工作..我不明白 – flenj

相關問題