Answer the question
In order to leave comments, you need to log in
How to display content in a dialog box depending on the button from which it opens?
I have a slider, it has several buttons with pictures and one dialog box. It is necessary to display the content in the window when clicked, depending on the image and the button. Can this be done via javascript and how? Or is it necessary for each button to have its own window? Help plz)
Answer the question
In order to leave comments, you need to log in
можно сделать) я использую модалки бутстрапа.
в слайдере так
<code lang="html">
<button id="con1" onclick="open1()">вызов первого контента</button>
</code>
<code lang="javascript">
function open1(){
тут функция вызова модалки;
тут применение стилей display:block; к элементу с классом content_1;
}
</code>
modal should look like this:<style>
[class^="content_"] {
display: none;
}
</style>
<div class="content_1">bla bla bla</div>
<div class="content_2">bla bla bla</div>
<div class="content_3">bla bla bla</div>
<div class="content_4">bla bla bla</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question