Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap modal not showing. Only background becomes black

I am using bootstrap modal. The triggrer is like this:

<a id="add-feed-button"  role="button" data-toggle="modal" href="#add-feed-form" class="btn pull-right btn-success"   style="margin-left:5px; margin-top:-4px;">Add new</a>

and my modal:

 <div id="add-feed-form" class="form-feed modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
this is modal.
</div> 

Problem is that only the backdrop becomes black but no modal appears.

I have included bootstrap.js and also bootstrap.min.css. I have used modals quite a times but this is a strange problem.

like image 455
Sankalp Mishra Avatar asked Oct 04 '13 09:10

Sankalp Mishra


People also ask

How do I disable background when pop modal is open?

The key idea is to have pointer-events: none; for the body when modal is open. But the specific elements you want to be interacted with should have e.g. pointer-events: auto; . In the example you can click both buttons when dialog is hidden, but only Toggle Dialog button when dialog is shown.

What is backdrop in Bootstrap modal?

The backdrop option specifies whether the modal should have a dark overlay (the background color of the current page) or not.


1 Answers

Remove .hide class from div#add-feed-form and then it will work fine.

Demo

like image 171
Shivam Chopra Avatar answered Sep 19 '22 11:09

Shivam Chopra