Y
Y
Yuri Yanin2016-06-08 23:07:19
JavaScript
Yuri Yanin, 2016-06-08 23:07:19

Is it possible to insert content into svg layer borders?

Появилась идея с использованием svg. Суть, примерно, такова: есть svg рисунок со слоями, часть из них анимируется с помощью jquery, с его же помощью есть необходимость наносить текст поверх одного из слоев. Да, можно использовать div с абсолютным позиционированием, но интересует есть ли способ работать с таким содержимым напрямую, а не накладывая блоки из вне с помощью css? Можно ли внедрить div блок в один из слоев svg и получить его отображение?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2016-06-09
@k12th

You can use foreignObject , but it won't work everywhere (IE, stop eating glue).
People complain that jQuery doesn't work well with SVG. If the animation is not interactive, then it is easy to do it through CSS, and if so, then you can try Angular/Ractive/Vue. Well, native work with the DOM is now almost more convenient than through jQuery.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question