Image opens modal dialog bootstrap

TerraElysio

Soooo I want to use these images I have so that when they are clicked it opens a modal dialog for a staff page on my site and I'm not sure how to do it

PS: I have seen something like this on here but its not what I wanted

<img src="https://minotar.net/helm/EpicMinerBackup">
<img src="https://minotar.net/helm/kingpooper27s">

EDIT~~~: Resolution to issue ~~~EDIT END~~

<!--####################### Start of the staff list ############################### -->
<img src="https://minotar.net/helm/EpicMinerBackup" data-toggle="modal" data-target="#Staff1" />

<div class="modal fade" id="Staff1" tabindex="-1" role="dialog" aria-labelledby="StaffModalLabel1" 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="StaffModalLabel1">EpicMinerBackup</h4>
      </div>
      <div class="modal-body">
        The Owner of the site and server.
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<!--########################################################################## -->

zveljkovic

You can use data attributes to load the modal box. img href value should match modal id value prefixed with #. In case below its #myModal. If it still doesn't work check JS errors or if the bootstrap js files are loaded.

<img href="#myModal" data-toggle="modal" src="https://minotar.net/helm/EpicMinerBackup">
<div id="myModal" class="modal fade" 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">×</button>
            <h3 id="myModalLabel">Modal header</h3>
    </div>
    <div class="modal-body">
        <p>One fine body…</p>
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
        <button class="btn btn-primary">Save changes</button>
    </div>
</div>
</div>
</div>

Here is the link for sample http://www.bootply.com/TH49jSYRm6

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Bootstrap modal dialog center image in body

From Dev

bootstrap modal opens but not visible

From Dev

Bootstrap modal opens wrong one

From Dev

href in modal dialog in bootstrap

From Dev

Validation in bootstrap modal dialog

From Dev

Twitter Bootstrap - Center Modal Dialog

From Dev

Using Bootstrap Clockpicker in modal dialog

From Dev

Default button in bootstrap modal dialog

From Dev

Bootstrap Modal Image Background

From Dev

Bootstrap 4 Modal anchor opens modal with specific tab active

From Dev

Bootstrap Modal opens but stays in gray background and cannot close or interact with modal

From Dev

re-size the modal dialog in bootstrap dynamically

From Dev

Not able to access bootstrap modal dialog in Selenium Webdriver

From Dev

Minimize or collapse a bootstrap 2.3.2 modal dialog?

From Dev

PDF file to be displayed on the dialog modal via bootstrap

From Dev

time-picker in bootstrap modal dialog

From Dev

Bootstrap modal-dialog is not getting display

From Dev

Jquery close bootstrap modal dialog completedly

From Dev

Displaying a bootstrap Modal dialog from Angular Controller

From Dev

Unit testing React Bootstrap modal dialog

From Dev

re-size the modal dialog in bootstrap dynamically

From Dev

How to show a modal dialog using bootstrap

From Dev

Bootstrap modal-dialog is not getting display

From Dev

Add a confirm bootstrap modal/dialog to checkbox

From Dev

time-picker in bootstrap modal dialog

From Dev

Bootstrap modal dialog set attributes from javascript

From Dev

Twitter Bootstrap 3 modal dialog not displaying

From Dev

How to detect the dismissal of a bootstrap modal dialog in javascript?

From Dev

Full Calendar event to bootstrap modal dialog not work

Related Related

HotTag

Archive