0

I used multiple bootstrap modal popup in my website. I want to add some class in following div name test when popup is opened. I found the class "modal-body" is added to the body tag.

enter image description here

Please see my above picture.

But I had nested modal popup. Please see my below fiddle location.

http://jsfiddle.net/tv8jd8py/1/

<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>

If I click the "Another Modal" button, the second popup is opened. Then I close the popup the "modal-body" class will be removed. Why?? Still My firt popup is visible. Please see my below image.

enter image description here

I want "modal-body" class will bestay, when I close the last modal popup. Please guide me. Or suggest alternate way. Thanks

Bowdzone
  • 3,827
  • 11
  • 39
  • 52
Akash
  • 295
  • 1
  • 5
  • 19
  • 2
    This might help you. http://stackoverflow.com/questions/19305821/multiple-modals-overlay – Bhojendra Rauniyar Sep 14 '15 at 04:50
  • `body` tag have the class which is overriding by that because your class is first added then override and removed so for last model you don't have any class. you can use `div` instead of `body` to solve this. – Insane Skull Sep 14 '15 at 04:59
  • Thank you @Nepal. I found my solution from stackoverflow.com/questions/19305821/multiple-modals-overlay – Akash Sep 14 '15 at 05:17

0 Answers0