问题描述
我在我的网站上使用Raphael.js.请在标题中查找徽标. http://hooche.ru/md2 徽标代码:
I'm using a Raphael.js on my site. Take a look logo in the header, please. http://hooche.ru/md2Code for logo:
<script type="text/javascript">
window.onload = function() {
var r = Raphael(logo); r.attr({href: "http://google.com/", target: "blank"});
other vector..
...
</script>
和徽标的html代码^
and html-code for logo^
<div id="logo"></div>
但是,现在,我们有了:1个字母= 1个Google链接=非常多的Google链接,并且在一个svg徽标中的字母周围都是空的,不可点击的空格.
But now, we have: 1 letter = 1 Google link = very much Google links and empty, not clickable spaces around letters in one svg-logo.
操作方法:1 svg-logo = 1链接到没有空格的地方,例如,div徽标具有:
How to do: 1 svg-logo = 1 link to somewhere with no empty spaces,for example, div logo have:
width: 190px;
height: 67px;
推荐答案
将div替换为链接,则也不需要r.attr()
位.
Replace your div with a link, then you won't need the r.attr()
bit either.
<a id="logo" href="http://google.com/"></a>
(我不建议在那里使用target="_blank"
.这不是标准行为.让最终用户选择.)
(I would not advise using target="_blank"
there. It's not the standard behaviour. Let the end user choose.)
这篇关于如何< href.>我与Raphael的svg徽标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!