Questions tagged [jquery-svg]

A jQuery plugin that lets you interact with an SVG canvas.

jQuery SVG is a plugin for that enables interaction with an SVG document or canvas.

SVG (Scalable Vector Graphics) is a language for describing two-dimensional graphics in XML, and JQuery SVG provides methods for manipulating the SVG and creating new SVG elements, and it provides a wrapper to use standard jQuery methods in SVG as well.

252 questions
292
votes
15 answers

jQuery SVG, why can't I addClass?

I am using jQuery SVG. I can't add or remove a class to an object. Anyone know my mistake? The SVG: The jQuery that won't add the class: $(".jimmy").click(function() { …
Don P
  • 49,839
  • 95
  • 259
  • 394
31
votes
11 answers

Create a map with clickable provinces/states using SVG, HTML/CSS, ImageMap

I am trying to create an interactive map where users can click on different provinces in the map to get info specific to that province. Example: archived: http://www.todospelaeducacao.org.br/ archived: http://code.google.com/p/svg2imap/ So far…
mindtheGaspar
  • 343
  • 1
  • 3
  • 9
12
votes
5 answers

Get bounding box for SVG path using jQuery

I want to get the getBBox() for svg path in jquery. i tried like this $("#"+ path id)[0].getBBox() -> returns x=0,y=0,width=0,height=0 I have added the path to an SVG element. I tried some other element in SVG, for example text node in that case it…
SivaRajini
  • 6,411
  • 17
  • 72
  • 117
11
votes
3 answers

Mozilla Firefox doesn't load SVG objects in addEventListener('load'

I don't know why, but it works on Chrome and Safari, not in Mozilla. I have object html tag that loads svg file. File contains .s0 classes. I want to handle event when you click on that class. Who knows what is wrong? sry, jsfiddle does not show…
sirjay
  • 1,565
  • 2
  • 25
  • 47
10
votes
5 answers

jquery animate for element attributes not style

ASAIK jquery animate function accepts style properties only. but i want to animate the attributes of an element. consider a SVG element rectangle i want to animate the rectangle…
SivaRajini
  • 6,411
  • 17
  • 72
  • 117
9
votes
1 answer

Live drawing of a line in D3.js

I'm just started with D3.js, and I want to create something like what we do in Paint to draw a line. The steps are should be the same: - Click on a point on the screen - Drag to the destination to create a line. What I'm having troubles now is when…
wayne
  • 191
  • 1
  • 1
  • 9
9
votes
2 answers

jQuery animate SVG element

I got a svg in my application. Like I got a svg element named '1_dice'. In a…
ramesh
  • 3,806
  • 13
  • 63
  • 108
9
votes
2 answers

SVG foreignObject not showing in Chrome

I have an SVG element with a foreignObject which contains a div. Then in my js I do this: $("#wrapper>svg>foreignObject>div").sparkline(data); which creates a canvas within the div. When I look at the firebug html code for the two browser…
ßee
  • 195
  • 5
  • 13
8
votes
2 answers

how to scale the element by keeping the fixed position in svg

i want to scale the below element in fixed position.
SivaRajini
  • 6,411
  • 17
  • 72
  • 117
7
votes
2 answers

JQuery and SVG - how to find the 'g' tag

Imagine this: How can I find the 'g' tag, I want that all tags could be clicked, and not just 'node1' or 'node2'. I've tried simular to this, but could not get it…
Kungen
  • 577
  • 1
  • 9
  • 24
7
votes
2 answers

How to place text in the center of an svg path

For rendering SVG I'm using jQuery SVG plugin. And, now I want to add text to each path and polygon. On jsFiddle you can see generated markup by plugin. For creating text I wrote the following code: var svgg = $("#rsr").svg('get'); var texts =…
user1260827
  • 1,398
  • 6
  • 29
  • 53
6
votes
3 answers

Fill svg path background. Fill not working

I need to create a speech bubble in SVG. Unable to fill the background of the svg path. I need to fill background color to this path. Fill is only coloring the border like stroke.
Atul Sharma
  • 6,551
  • 9
  • 34
  • 53
6
votes
1 answer

Bootstrap Tooltip Not showing on SVG Hover

Can you please take a look at this LINK and let me know why the bootstrap tooltip not showing on this svg? Here is the code I have
Mona Coder
  • 5,750
  • 15
  • 55
  • 103
6
votes
1 answer

How to call a function in the parent html document from an embedded svg

I'm quite new to svg and I have to perform a task with it, but I'm having lots of troubles. I have an svg (a map for instance) with areas defined by paths. My goal is to trigger onClick a function external to the svg to do some stuff (for instance,…
Alex
  • 171
  • 2
  • 10
5
votes
2 answers

Text editor for svg text

I am currently working with svg and its dom manipulation... Are there any WYSIWYG editors for SVG text. I have browsed so much, but can find only editors for html text. If someone can suggest one it would be of great help to me. Thanks in advance.
Srikrishnan Suresh
  • 614
  • 2
  • 12
  • 29
1
2 3
16 17