I create a very simple, but slightly modified, able to display iFrame. I open the model using the javascript function and the modal call function provided by bootstrap. In my modal I placed an icon to close the modal. If I click on this close icon, the modal will not hide. I am using javascript onclick with the .modal('show') and .modal('hide') functions provided by bootstrap. Modal does not hide, but my console log is running.
I know that there are many questions with a similar problem, but these questions did not contain the answer I was looking for. I know that css in html is just wrong, but I did some quick prototypes, so please forgive me for that.
code
Open link for modal
<a href="#" onClick="openFeedback('getBootstrap')">Klik hier om de website te bekijken</a>
Modal html
<div class="modal fade" id="iframe_feedback" style="padding-top: 20px;"> <i class="ion-close-round close-modal" style="position: fixed; right: 40px; font-size: 32px; color: white; top: 40px; cursor: pointer;" onClick="closeModal()"></i> <div class="body-modal" style="max-width: 90%; margin: 0 auto; overflow: scroll;"> <div id="clip" style="overflow:scroll;"> <iframe src="/dashboard" style=" width:2600px; height: 1600px;"></iframe> </div> </div> </div>
Js
function openFeedback(link) { $('#iframe_feedback').modal('show'); console.log(link); }; function closeModal() { $("#iframe_feedback").modal('hide'); console.log('Close fired'); };
My main problem is that my modal is showing, console.log also triggered to show and hide, but after clicking the close button, the modality is not hidden.
source share