Home > DeveloperSection > Forums > How to open Bootstrap modal popup
Goti Bandu

Total Post:119

Points:835
Posted on    September-30-2014 7:26 AM

 Bootstrap Bootstrap  CSS-CSS3  JQuery 
Ratings:


 1 Reply(s)
 1274  View(s)
Rate this:
i'm want to open bootstrap modal popup smoothly


Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    September-30-2014 7:44 AM

Hi goti Bandu
i'm try to make bootstrap modal popup so firstly use three files

<link href="~/Content/bootstrap-3.1.1-dist/css/bootstrap.min.css" rel="stylesheet" />

<script src="~/script/jquery-2.1.0.min.js"></script>

<script src="~/script/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>

html code here:

<div class="container">

    <br />

    <br />

    <button class="btn btn-primary" id="launchmodal" data-toggle="modal" data-target="#myModal">

        Launch demo modal

    </button>

</div>

 

<!-- Modal -->

<div class="modal fade" id="myModal" 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"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>

                <h4 class="modal-title" id="myModalLabel">Modal title</h4>

            </div>

            <div class="modal-body">

                ...

            </div>

            <div class="modal-footer">

                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

                <button type="button" class="btn btn-primary">Save changes</button>

            </div>

        </div>

    </div>

</div>

javascript code:

<script>

    $(document).ready(function () {

        $('#launchmodal').click(function () {

            $('#myModal').modal({

                keyboard: false

            })

        });

 

    });

</script>


Don't want to miss updates? Please click the below button!

Follow MindStick