S
S
Sergey750il2015-08-01 00:57:28
JavaScript
Sergey750il, 2015-08-01 00:57:28

Is it possible to make a jQuery selection from an SVG map?

Good day. The task was to make an interactive map of the office building. Only the main problem is that when renting an office, its color on the map should change. The admin himself will not be able to edit the files. The whole thing must be integrated into WordPress and when editing a post, the busy / free checkbox must be ticked. It's not a problem to do this through arbitrary fields, but how to change the color on the map. I came up with the idea through jquery to select the office I need and if, for example, office 112 - in an arbitrary field the value is "busy", then change the color using jquery methods. Now the task is how to properly select from a DOM tree with an SVG map. I can’t find any clues on what principle to choose offices, since there is no name or id in the path, only the stroke and fill attributes are present. I do it on Raphael.
I am attaching a screenshot:
a99e0d38374247dab216eb2243ffe796.JPG

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question