【发布时间】:2020-06-19 00:37:38
【问题描述】:
当我点击我的 svg 元素时,我试图重定向到另一个 HTML 页面。这是我尝试过的方法。
draw.rect(300, 250).move(1100, 200).attr ({
fill: 'grey',
stroke: '#000',
'stroke-width': 3
})
.click(function() {
href="./index.html"
})
希望得到一些帮助
【问题讨论】:
-
draw.rect用于画布,而不是 SVG。你在使用一些图书馆吗? -
您可能想在您的
.click()函数中执行window.location.href = './index.html',对吧?
标签: javascript html svg svg.js