Hi,
I’ve started learning Bootstrap from you but I got a project and I wanna do it with bootstrap. I’m stuck now!
I have a modal which has a dropdown-menu with 4 li’s and I’ve set data-toggle=”collapse” for each li.
For each option I have sepparate div with id and class=”collapse”. they are opening ok
If I click option1 it opens div with his id, after I click option2 it opens div for him but it doesn’t close my other div which not belongs to him. I want every option from dropdown-menu to open it’s div after closing the other one if one was opened before.
<div class=”btn-group”>
<button type=”button col-md-4″ class=”btn btn-default dropdown-toggle” data-toggle=”dropdown” aria-expanded=”false”>
Tehnic <span class=”caret”></span>
</button>
<ul class=”dropdown-menu” role=”menu”>
<li><a id=”” href=”#print” data-toggle=”collapse”>Imprimanta</a></li>
<li><a id=”” href=”#pc” data-toggle=”collapse”>PC/Laptop</a></li>
<li><a id=”” href=”#telefon” data-toggle=”collapse”>Telefon</a></li>
<li><a id=”” href=”#altele” data-toggle=”collapse”>Altele</a></li>
</ul>
</div>
<div id=”print” class=”collapse”>
<p>option1</p><textarea class=”form-control” rows=”3″></textarea>
</div>
<div id=”pc” class=”collapse”>
<p>option2</p><textarea class=”form-control” rows=”3″></textarea>
</div>
<div id=”telefon” class=”collapse”>
<p>option3</p><textarea class=”form-control” rows=”3″></textarea>
</div>
<div id=”altele” class=”collapse”>
<p>option4</p><textarea class=”form-control” rows=”3″></textarea>
</div>
You need to use Jquery or Javascript for this. There many ways to do this. Do you still want to do it?
I had to move on so I’ve put the dropdown-menu in the first page and nou every option from him, opens his own modal. I will continue my learning from you. Keep up the good job. Thanks!