Bootstrap Modal With Iframe on-the-fly

5 March 2015
var modalStr = function() {/*
<div class="custom-modal modal fade" id="myModal" 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-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      <div class="modal-body">
*/}.toString().slice(15, -4);
var customModal = $(modalStr);
// give any anchor with class modalizer will open its location with a modal
    $(".modalizer").click(function (e) {
        var a = $(this);
       var modal_width ="width") ?"width") : '800';
       var modal_height ="height") ?"height") : '400';
        $("#myModal .modal-body").html('<iframe style="width:100%;height:99%;min-height:' + modal_height + 'px;border:0;"  src="' + $(a).attr("href") + '"></iframe>');
            keyboard: false
        $('.custom-modal').on('hidden', function () {


Görüşünüzü paylaşın

(No HTML, Textile help only please.)