Bootstrap 3 and Youtube in Modal

后端 未结 18 1482
余生分开走
余生分开走 2020-12-07 07:05

I\'m trying to use the Modal feature from Bootstrap 3 to show my Youtube video. It works, but I can\'t click on any buttons in the Youtube video.

Any help on this?<

18条回答
  •  伪装坚强ぢ
    2020-12-07 07:23

    If you don't want to edit the bootstrap CSS or all of the above doesn't help you at all (like in my case), there's an easy fix to get the video running in a modal on Firefox.

    You just need to remove the "fade" class from the modal and as it opens the "in" class, too:

    $('#myModal').on('shown.bs.modal', function () {
        $('#myModal').removeClass('in');
    });
    

提交回复
热议问题