Use Lightbox with iFrame Link

info2559
7 Posts
info2559 posted this 29 August 2016

Is there an option to open an iFrame with a lightbox?
I have tried different bootstrap modal scripts, but i couldn't get it work.

This is my html code:

<pre>
<a href="http://alpregio.outdooractive.com/ar-kaernten-ht/de/alpregio.jsp#q=heiligenblut&amp;tab=SearchTab" class="btn bootpopup" title="This is title" target="popupModal2">Open modal</a>
<div id="popupModal2" class="modal hide fade" tabindex="-1" role="dialog">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
            <h3>Title</h3>
    </div>
    <div class="modal-body">
      <iframe src="http://alpregio.outdooractive.com/ar-kaernten-ht/de/alpregio.jsp#q=heiligenblut&amp;tab=SearchTab" style="zoom:0.60" frameborder="0" height="250" width="99.6%"></iframe>
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal">OK</button>
    </div>
</div>

And my script:

    <script>
jQuery('.bootpopup').click(function(){
    var frametarget = $(this).attr('href');
  var targetmodal = $(this).attr('target');
  if (targetmodal == undefined) {
    targetmodal = '#popupModal';
  } else { 
    targetmodal = '#'+targetmodal;
  }
  if ($(this).attr('title') != undefined) {
    $(targetmodal+ ' .modal-header h3').html($(this).attr('title'));
    $(targetmodal+' .modal-header').show();
  } else {
     $(targetmodal+' .modal-header h3').html('');
    $(targetmodal+' .modal-header').hide();
  }  
    $(targetmodal).on('show', function () {
        $('iframe').attr("src", frametarget );   
    });
    $(targetmodal).modal({show:true});
  return false;


});
</script>

The bootstrap modal should work, isn't it? Why it doesn't?

Regards,
Bettina

Is there an option to open an iFrame with a lightbox? I have tried different bootstrap modal scripts, but i couldn't get it work. This is my html code: <pre> <a href="http://alpregio.outdooractive.com/ar-kaernten-ht/de/alpregio.jsp#q=heiligenblut&amp;tab=SearchTab" class="btn bootpopup" title="This is title" target="popupModal2">Open modal</a> <div id="popupModal2" class="modal hide fade" tabindex="-1" role="dialog"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h3>Title</h3> </div> <div class="modal-body"> <iframe src="http://alpregio.outdooractive.com/ar-kaernten-ht/de/alpregio.jsp#q=heiligenblut&amp;tab=SearchTab" style="zoom:0.60" frameborder="0" height="250" width="99.6%"></iframe> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal">OK</button> </div> </div> And my script: <script> jQuery('.bootpopup').click(function(){ var frametarget = $(this).attr('href'); var targetmodal = $(this).attr('target'); if (targetmodal == undefined) { targetmodal = '#popupModal'; } else { targetmodal = '#'+targetmodal; } if ($(this).attr('title') != undefined) { $(targetmodal+ ' .modal-header h3').html($(this).attr('title')); $(targetmodal+' .modal-header').show(); } else { $(targetmodal+' .modal-header h3').html(''); $(targetmodal+' .modal-header').hide(); } $(targetmodal).on('show', function () { $('iframe').attr("src", frametarget ); }); $(targetmodal).modal({show:true}); return false; }); </script> The bootstrap modal should work, isn't it? Why it doesn't? Regards, Bettina
Vote to pay developers attention to this features or issue.
3 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 30 August 2016

Hello Bettina,
have you tested this solution outside Themler or with one of default CMC themes? Does it work?
If yes, then the issue may be related to Themler. In this case please provide access to your CMS admin back end

Regards,
Aileen

Hello Bettina, have you tested this solution outside Themler or with one of default CMC themes? Does it work? If yes, then the issue may be related to Themler. In this case please provide access to your CMS admin back end Regards, Aileen
info2559
7 Posts
info2559 posted this 31 August 2016

Thanks, i have tested the code in jsfiddle. But it's ok now, i installed fancybox and did it with the plugin.

Your support is really great, thanks for your help!

Thanks, i have tested the code in jsfiddle. But it's ok now, i installed fancybox and did it with the plugin. Your support is really great, thanks for your help!
Support Team
Support Team posted this 01 September 2016

Thanks, you are welcome. Please let us know if you need our further assistance.

Sincerely,
Hella

Thanks, you are welcome. Please let us know if you need our further assistance. Sincerely, Hella
You must log in or register to leave comments