Home>
<div class="container"> <div id="gallery" class="container-fluid"> <img src="/images/landscaping.jpeg" class="img-responsive"> </div> <div id="myModal" class="modal""> </div></div>
-
Answer # 1
It's not clear what problem you're facing. Add click handlers for images. Add an img tag to the modal. On click, get the src of the clicked one, and put it in the src of the modal. Display modal.
$("#gallery img").click(function(){ $("#target-img").attr('src', $(this).attr('src')); $("#modal").show(); });
Related questions
- javascript : How to convert date to another format?
- javascript : How do I make sequential ajax /fetch requests correctly?
- javascript : Subscriber counter
- javascript : The "Resize ()" event fires on the phone even if you just scroll the page
- javascript : How do I add the required attribute to only the selected radio button?
- javascript : How do I make a select valid?
- javascript : How do I validate select?
- javascript : jquery send ajax only 1 request
- javascript : How to determine if an element is within the scope of the browser window?
- javascript : Opening a modal window depending on a button
Please edit the question to reflect the specific problem with enough detail to be able to give an adequate answer.
Дух сообщества2022-02-12 22:24:14