小编cpa*_*mer的帖子

模态关闭时停止播放视频

我正在使用以模式打开的HTML中的视频标签。目前,如果我退出模式而不暂停视频,它仍在播放。我还没有JavaScript,因为我添加的所有内容均无法正常运行。我也在使用引导程序。这是我的HTML:

<button type="button" data-toggle="modal" data-target="#myModal">
  <h4>SHORT SLEEVED SHIRT<br><br>$20</h4>
  <img src="images/femaleshortsleeved.jpg"> </button>
  <!-- Modal -->

  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <video class="video" width="960px" controls>
                <source src="images/Short Sleeved Shirt.mp4" type="video/mp4">

            </video>
            <h2>Short Sleeved Shirt<br>$20</h2>
            <h5>90s lightweight brown patterned shirt.<br>No marked size.<br>Will fit S to M.<br>Length: 62cm<br>Width: 56cm</h5>
            <button type="button" class="btn btn-primary btn-lg">BUY NOW</button>
      </div>
    </div>
  </div>
Run Code Online (Sandbox Code Playgroud)

html javascript jquery modal-dialog twitter-bootstrap

0
推荐指数
3
解决办法
1万
查看次数