Skip to Content
Mastering SVG
book

Mastering SVG

by Rob Larsen
September 2018
Beginner to intermediate
312 pages
7h 22m
English
Packt Publishing
Content preview from Mastering SVG

Manipulating SVG with jQuery

The first library we'll look at is jQuery. jQuery isn't as hot as it once was, but it's still the most popular JavaScript library on the planet, and understanding the quirks of using SVG with jQuery is still potentially useful.

Since jQuery functions as a friendly replacement for common DOM interactions, this section will feature a jQuery-based rewrite of the DOM manipulator demo we worked on in Chapter 6, JavaScript and SVG.

It uses the exact same markup, so the only place we need to look at in this chapter is the script block at the bottom. 

This code will be written in idiomatic jQuery/ES5.

The first thing we'll look at is the function we'll fire on jQuery's equivalent of the DOMContentLoaded event, $(document).ready() ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern SVG

Modern SVG

Amelia Bellamy-Royds, Kurt Cagle
Using SVG with CSS3 and HTML5

Using SVG with CSS3 and HTML5

Amelia Bellamy-Royds, Kurt Cagle, Dudley Storey
SVG Text Layout

SVG Text Layout

Amelia Bellamy-Royds, Kurt Cagle

Publisher Resources

ISBN: 9781788626743Supplemental Content