H
H
honormgr2016-12-19 15:47:16
Design
honormgr, 2016-12-19 15:47:16

How to make a dynamic modal window?

Hello.
There are a lot of modal windows on the site (they are all the same in format, only the data in them changes).
They are directly embedded in the HTML code using bootstrap (library modal.js).
How to make the modal window dynamically formed from the parameters passed to it, for example, I often saw such a method of transferring content on sites data-name_parametr.
What do you suggest?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
iBird Rose, 2016-12-19
@honormgr

создаешь модалку через js https://jsfiddle.net/vh88u4uh/ и кидаешь туда контент какой хочешь через json

Павел, 2016-12-19
@PavelMonro

Гуглится это легко
Баг на GitHub и фикс там же
Стак

Александр, 2016-12-19
@WDMGroup

Попробуйте вот эту технику Varying modal content based on trigger button. Т.е. по сути задаёте свои атрибуты, далее "ловите" их и формируете само содержимое modal-окна на их основе. Вот и получится динамическое модальное окно.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question