-
Notifications
You must be signed in to change notification settings - Fork 0
/
_modal.slim
24 lines (23 loc) · 934 Bytes
/
_modal.slim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalLabel">New message</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<img src="" class="imageurl" style="width: 400px; height: 264px;" >
</div>
</div>
</div>
</div>
javascript:
$('#modal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var imageurl = button.data('imageurl') // Extract info from data-* attributes
var modal = $(this)
var img = modal.find('.imageurl')
img.attr('src', imageurl)
})