简体   繁体   中英

What browsers support interactive SVG documents?

I'm working on a project that requires an interactive map. I want to use an SVG document with some custom javascript code embedded in it much like this developer has done:

http://treeblurb.com/xmap/svg/melbourne_central.svg

Achieving what I want to do is trivial but I can't tell which browsers would support this level of interaction. Essentially I need to:

  1. Embed custom script tags into the document.
  2. Adjust attributes of nodes (ie fill)
  3. Add mouse events to specific elements.

I guess my question is - if a browser supports native SVG, would it allow me to do all of these things?

Native SVG is supported by most versions of Chrome, Firefox, Opera and Safari. IE8 does not support it, but IE9 and above does. Android supports it from Honeycomb onward.

You may want to take a look at Raphael . It not only makes SVG-like functionality available in IE8 and below (by falling back to VML), it also provides methods to manipulate all objects, which you can even combine with JQuery.

There's also good information comparing Raphael to JQuery SVG here .

IE 8 and earlier does not support SVG. Android 2.3 and earlier also does not support SVG. Check out more browser compatibility issues here: http://www.caniuse.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM