1,105,286 Community Members

Bootstrap modal hide does not work

Member Avatar
Junior Poster
123 posts since Dec 2009
Reputation Points: 25 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 2 [?]

Hello good people of Daniweb :)

I am developing a site with codeigniter 1.2.2 and the latest version of bootstrap.

I am calling a modal window but the X and Close buttons don't close the window.

Tried alerting when clicking a button and I do get the alert but the window stays open.

Can someone please help?

My page source:

    <meta charset="UTF-8">
    <title>thinklocal: thinklocal</title>
    <!-- Bootstrap -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="http://localhost/thinklocal/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://localhost/thinklocal/css/bootstrap-responsive.min.css" rel="stylesheet">
    <link href="http://localhost/thinklocal/css/styles.css" rel="stylesheet">
  <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script src="http://localhost/thinklocal/js/bootstrap.min.js"></script>
        $(function() {
                             $('.btn').click(function() { alert('h');
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <body style="background: #555;">
        <div id="myModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h2 id="myModalLabel">View Back Issues</h2>

<div class="modal-body">
      <table class="table table-hover">
            <th>Issue Date</th>
        <th>View Issue</th>
        <td><img class="thumb" src="http://localhost/thinklocal/uploads/issues/freestate/thinklocal/img/dec2012.jpg" /></td>
            <div class="modal-footer">
          <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
                &copy; 2013 thinklocal          </div>
        $(function() {
                             $('.btn').click(function() { alert('h');
Deleted Member

I am developing a site with codeigniter 1.2.2 and the latest version of bootstrap.

Does the bootstrap worked before you merge it to codeigniter?

Where is your bootstrapButton code?

I assume you got that code from here:


or here:


This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: