Bootstrap图片中加播放按钮

                                                                       Bootstrap图片中加播放按钮

1、效果图

2、代码

<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
	<title>Bootstrap图片中加播放按钮</title>
 
	<!-- Bootstrap -->
	<link href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
	<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
	<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
	<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
	<script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
	<style>
			
	</style>
</head>
<body>
	<div>
		<div style="padding-left:300px;">
			<h3>观看视频</h3>
		</div>
		<p style="position:relative;">
			<img onclick="seeVideo()" src="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1181062145,1954327019&fm=26&gp=0.jpg"  style="height:400px;width:760px;border-radius: 10px;" alt=""/>
				<span onclick="seeVideo()" class="glyphicon glyphicon-play-circle" 
					style="height: 80px;width: 80px;position: absolute;left: 340px;top: 160px;font-size: 80px;color: #fff;"></span>
		</p>
	</div>
	
	<!-- 视频观看的DIV START-->
	 	<div class="modal fade" id="modal_id" tabindex="-1" role="dialog">
	      <div class="modal-dialog">
	        <div class="modal-content" style="height:550px;width:700px;">
	          <div class="modal-header">
	          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	            <h4 id="chapter_title">标题</h4>
	          	</div>
	          	<div class="modal-body">
	           		<video id="backPlay_id" style="height:450px;width:660px" src="" controls="controls"></video>
	           	</div>
	          </div>
	          <div class="modal-footer">
	            <!-- <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
	            <button class="btn btn-primary" type="button" data-dismiss="modal">Proceed</button> -->
	          </div>
	      </div>
	    </div>
	    <!-- 视频观看的DIV END-->
</body>
<script>
	//弹出视频框
	function seeVideo(){
		$("h4#chapter_title").text('动态显示视频的标题');		//设置标题
		$('#backPlay_id').attr('src', 'http://d.itheima.com:81//dd/Python/Scrapy%E7%88%AC%E8%99%AB%E6%A1%86%E6%9E%B6/00.Scrapy%E6%9E%B6%E6%9E%84%E6%B5%81%E7%A8%8B%E4%BB%8B%E7%BB%8D.mp4');//设置视频地址
		$('#modal_id').modal('show');//显示出弹出层
	}
</script>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值