Q:

Bootstrap 3 modal does not close on outside click

I have created a modal using call,
 $('#myModalContent').modal('show');

html is:
<div class=" modal fade" id="myModalContent" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body">

            </div>

        </div>
    </div>
</div>

Problem is when i click outside the modal popup, its doesn't close. ( its closes on esc)

A:

I have written custom code to solve this. 
   $("body").on("click", ".modal-dialog", function(e) {
        if ($(e.target).hasClass('modal-dialog')) {
            var hidePopup = $(e.target.parentElement).attr('id');
            $('#' + hidePopup).modal('hide');
        }
    });

A:

Just add data-backdrop="static" and data-keyboard="false" attributes to that modal (ie where you have class='modal')
data-backdrop="true" is the default behaviour that allows for background click dismissal and data-backdrop="static" is the behaviour that your explaining, no dismissal, so probably you have set it somewhere to "static". 
data-keyboard="false" is for not allowing ESC

