我看到這個計算器上其中工程超鏈接中的JavaScript/CoffeeScript中
a = document.createElement("a")
linkText = document.createTextNode("my title text")
a.appendChild linkText
a.title = "my title text"
a.href = "http://example.com"
document.body.appendChild a
我需要類似的東西,但我的問題是,我使用的是從這裏圖表:
和我需要圖表的標題才能成爲超鏈接!
在我的CoffeeScript我有以下幾點:
p5 = new JustGage(
id: p["name"]
value: p["value"]
min: 0
max: 100
title: (p["name"]).link p["url"] # My problem is here
)
現在這是我所看到的:附有圖片:
<a href='http://www.google.com'>test</a>
謝謝!!
@ muistooshort:它使用的是基於SVG的Raphael,所以沒有'
哦謝謝!我會研究這個! – nevermind
@Bergi:謝謝,我把我的畫布和SVG混合起來,結果我對任何一個都不太瞭解:) –