1

Is it possible to show a modal window only if embedded iframe is fully loaded (an embedded pdf)?

//triggered by frontend
$scope.onmodal = function() {
    $scope.url = "dynamic generated url";
    $('#myModal').modal({
        show: true, //how to delay?
        backdrop: true
    });
};

My html: Trigger Modal in iFrame

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="position:inherit !important;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">PDF View</h4>
      </div>
      <div class="modal-body">
          <iframe ng-src="{{url}}" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>  
      </div>
    </div>
  </div>
</div>

I want to trigger the modal popup on button click, but delay it until the embedded url (a pdf) has been fully loaded. Because the pdf is generated in the backend, and a long running process (10 sec).

Is it possible?

membersound
  • 81,582
  • 193
  • 585
  • 1,120
  • Try using ONLOAD ` – Liadco Feb 22 '16 at 17:45
  • Possible duplicate of [Angular, onLoad function on an iFrame](http://stackoverflow.com/questions/15882326/angular-onload-function-on-an-iframe) – membersound Feb 23 '16 at 08:39

0 Answers0