load iframe in bootstrap modal

后端 未结 6 1636
青春惊慌失措
青春惊慌失措 2020-12-14 22:00

I want to load an iframe into a bootstrap modal and show a loader before the iframe is loaded. I am using a simple jquery click function, but it is not working. I do not und

6条回答
  •  太阳男子
    2020-12-14 22:38

    Bootstrap event for modal load was changed in Bootstrap 3

    just use shown.bs.modal event:

    $('.modal').on('shown.bs.modal', function() {
        $(this).find('iframe').attr('src','http://www.google.com')
    })  
    

    More can found on the event at the below link:

    http://getbootstrap.com/javascript/

提交回复
热议问题