问题描述
你怎么做一个SVG互动?有谁知道在哪里可以找到的教程?我很想得到的最近资源的好清单,以帮助使用SVG大家学习动态和交互式图形。
How do you make an SVG interactive? Does anyone know where to find tutorials? I'd really like to get a good list of recent resources to help everyone learn dynamic and interactive graphics using SVG.
在'互动',我要找的是给人一种SVG事件处理程序,让用户通过图形(AJAX)提交或接收新数据的例子。
An example of the 'interactivity' I am looking for is giving an SVG event handlers and letting a user submit or receive new data through the graphic (AJAX).
在SVGs所有的书都是从2008年或更早,所以没有使用现代技术(jQuery的或AJAX)。在所有的StackOverflow脚本SVG的职位是从2010年开始,大部分也由2008年。
All books on SVGs are from 2008 or earlier, so there is no use of modern techniques (jQuery or AJAX). All the posts on scripting SVG on Stackoverflow are from 2010 and most are also from 2008.
拉斐尔似乎是被广泛接受与SVG的工作库。这似乎提供了良好的高级功能。
Raphael seems like the widely accepted library for working with SVG's. It seems to provide good high level functions.
Tutorial对于拉斐尔
推荐答案
我肯定会看看 RaphaelJS 这允许操纵SVG比从零开始的JavaScript这样做更容易。有关于如何使用事件来实现它的一些例子。但是,您可以使用JavaScript或没有任何流行的JavaScript框架外面的帮助下操纵它。与SVG的事情是,它采用了被视为DOM的一部分内容。所以,图像将是与容器的元件。这是有帮助的,因为你可以把点击事件到这些孩子的元素。
I would definitely take a look at RaphaelJS which allows manipulating SVG easier than doing it with javascript from scratch. There are some examples on how to implement it using events. However, you can manipulate it with javascript with or without the help of any of the popular javascript frameworks out there. The thing with SVG is that it uses elements that are treated as part of the DOM. So, an image would be an element with the container. This is helpful since you can place click events onto those children elements of .
这篇关于如何使一个SVG互动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!