Having trouble getting the popover window to appear in Bootstrap when utilizing the modal class?

I attempted to create a responsive image gallery using the bootstrap framework. Each image has its own modal class, but when I click on an image, no popup window appears, only a dark screen is displayed. I have checked this in the Bootstrap documentation and tried different browsers, but I am still encountering the same issue. Here is my code:

    <html>
<head>
<title>@ John Doe</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" />
</head>

<body>
 <div class="span6">
      <h2>Sample Club Members</h2>
      </div>
<div class="container">
  <div class="row">
    <div class="span6">
      <ul class="thumbnail">
        <li class="span2"><a href="#popup" class="thumbnail" data-toggle="modal"><img src="img/sample1.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup1" class="thumbnail" data-toggle="modal"><img src="img/sample2.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup2" class="thumbnail" data-toggle="modal"><img src="img/sample3.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup3" class="thumbnail" data-toggle="modal"><img src="img/sample4.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup4" class="thumbnail" data-toggle="modal"><img src="img/sample5.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup5" class="thumbnail" data-toggle="modal"><img src="img/sample6.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup6" class="thumbnail" data-toggle="modal"><img src="img/sample7.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup7" class="thumbnail" data-toggle="modal"><img src="img/sample8.jpg" alt=""></a></li>
        <li class="span2"><a href="#popup8" class="thumbnail" data-toggle="modal"><img src="img/sample9.jpg" alt=""></a></li>
        </ul>
    </div>
  </div>
  <!-- close row -->

<div id="popup" class="modal hide fade" tabindex="-1">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">x</button>
        <h3>John Doe</h3>
      </div>
      <div class="modal-body">
      <p><img src="img/sample1.jpg" alt="" class="pull-right"> Example description for the first member.</p>
      </div>
      <div class="modal footer">
       <button class="btn" data-dismiss="modal">Close</button>
      </div>
    </div>

<script src="js/jquery-1.11.0.min.js"></script>
 <script src="js/bootstrap.min.js"></script> 
</body>
</html>

Answer №1

Opting for a unified modal to display all your gallery images is highly recommended. Ensure that your modal remains hidden until the user either clicks outside it or presses the escape key. Using a single modal for your entire gallery would be a more efficient approach.

Customize the content of your modal-body according to your specific needs.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Triggering an Ajax call for form validation only occurs when the form is not validated

I am struggling with a simple form that has an Ajax call, but the ajax call gets executed even if the form is not validated. In the code snippet below, the line console.log("This line should execute only if Form is validated"); gets executed when the form ...

React - group several elements within a wrapping container

I am dealing with an array of words that make up sentences: let words = [ { "start_time": "2.54", "end_time": "3.28", "alternatives": [ { "confidence": "1.0", ...

How can a webpage be automatically refreshed when it is resized using jQuery?

My website has indicator displays settings that float above a menu. The issue is that when the user resizes the page, the indicators remain in the same place and the page needs to be refreshed to position them correctly. Is there a way for the page to refr ...

Cross-Origin Request Blocked: "Sorry, we can only support requests for protocol schemes using HTTP" and so on

I have been working on setting up a simple application that involves an Express backend which returns a JSON string when accessed at localhost:4201/ticker. However, I encountered an issue while trying to make a request to this link from my Angular Service ...

Getting access to the parent's ref from child components in Vue/Nuxt can be achieved by using

Incorporating a global confirm modal component into my default layout file has been a challenge. Attempting to access this component from my pages/index.vue has proven to be unsuccessful, as calling this.$refs returns an empty object. While placing the mod ...

What is the best way to display AdSense ads exclusively on webpages with a height exceeding 2400 pixels?

Looking to gather data on page height in order to display adsense only on pages with over 2400px height. Any suggestions would be greatly appreciated! <script> var height = $(document).height(); if (document > 2400 ) { echo '<!--adsense ...

select2 with customizable multi-column layout

Looking to create a multi-column select2 with a dynamic number of columns by specifying the number of columns as a data attribute in the select tag, or utilizing another method. <select data-cols="2,6,4"> <!--note data-cols--> < ...

Utilizing Flexbox for Spacing

When utilizing flex containers, is it considered safe and acceptable to apply margin-top, margin-bottom, margin-left, margin-right, and padding to create a little space between elements or shift them to the left or right? Or is it more advisable to use f ...

Angular - Uncaught TypeError: XX is not a function on the site

Seems like I might be overlooking a property somewhere, but as I'm following this project, I encountered this error in my controller. TypeError: loginService.signin is not a function This is the content of my controller.js file angular.module(&apos ...

Why do my paths encounter issues when I alter the manner in which I deliver my index.html file?

I recently made a decision to change the method of serving my index.html file from app.use('/', express.static(__dirname + '/..')); to app.get('/', function(req, res) { res.sendFile(path.join(__dirname + '/../index.htm ...

Can you explain the inner workings of the provided code in a step-by-step manner?

I stumbled upon this code snippet that checks if the number of occurrences of an element in an array is greater than a specified value, and if so, it will remove the number: function deleteNth(arr,x) { var cache = {}; return arr.filter(function(n) { ...

A row divided into three segments in Twitter Bootstrap2, with the second segment spanning the rest

Looking to divide a row into three segments under the following conditions: The first segment should have a maximum height and always stay at the top (minimum height of 0; maximum height of 40%). If the content exceeds the max-height, a scroll bar sho ...

Integrating Mailchimp with MongoDB and Node.js

As of now, I am managing a database of users in MongoDB and my goal is to provide them with regular updates on new content available on a real-estate marketplace website on a daily basis. My plan is to send out email notifications to each user every day w ...

Why isn't the footer extending to the edges despite setting margins and other properties?

Feeling a bit lost here. My footer isn't extending to the edges of the window like it should, or so I thought. .footer { height: 200px; bottom: 0px; margin: 0px; left: 0px; right: 0px; padding: 0px; width: 100%; background-color: #E ...

How can we automatically redirect users to an external website based on their responses to a specific question in SurveyJS?

Within my SurveyJS json, I have a radiogroup question that prompts users to make a choice. If they select a specific option, I'd like to redirect them to a different page. Otherwise, I want them to continue with the survey. Is this achievable? (The s ...

Locate a JQuery element within another JQuery element

Apologies for my poor grasp of English. I am working with HTML and JavaScript. <noindex> <h1>This is h1 in noindex</h1> <div> <h1>This is h1 in noindex and in div</h1> <div> <h1>This is h1 in noindex a ...

Can we establish communication between the backend and frontend in React JS by utilizing localstorage?

Trying to implement affiliate functionality on my eCommerce platform. The idea is that users who generate links will receive a commission if someone makes a purchase through those links. However, the challenge I'm facing is that I can't store the ...

Struggling to find the right alignment for my Bootstrap card design

I'm attempting to center a card in the middle of the screen. While I was able to horizontally center it using mx-auto, I'm facing difficulties with vertical centering. I tried using mt-3 to add margin-top to the card, but it only gives me about ...

I am seeking guidance on creating a dynamic search feature using node.js and mongoDb. Any input regarding

I am currently working on implementing a unique feature that involves having an input field on this specific page. This input allows users to perform a live search of employees stored in the database. app.get('/delete' , isLoggedIn , (req , res) ...

Combining two arrays into one array using a foreach loop

let colors = ["red", "blue"]; let sizes = ["s", "m", "L"]; //Desired output: let finalResult = [ { id: 0-0, val: 'red/s' }, { id: 0-1, val: &a ...