Asked 17 days ago
25 Nov 2017
Views 35
shabi

shabi posted

how to put iframe in modal box in boostrap ?

how to put iframe in modal box in boostrap ?
Mitul Dabhi

Mitul Dabhi
answered Dec 12 '17 20:17


script type="text/javascript">
    
    var frameSrc = "www.google.com";
  $('.activity').click(function(){
  var frameSrc = $(this).attr("data");
  
     $('#myModal').on('show', function () {
 
        $('iframe').attr("src",frameSrc);
 
	});
    $('#myModal').modal({show:true})
});
</script>



<a href="javascript:;"  data="www.yahoo.com" class="activity">See Activity</a>
<div class="modal fade" id="myModal" " tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" style="width: 950px;height:400px" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
      
              <iframe src="" width="100%"  height="100%" ></iframe>

       </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
Edit Answer
Share
not working - angeo  
Dec 4 '17 05:45
Post Answer