论坛
标题:
预览时还没点击“登陆”按钮,音乐就想起来了,哪出问题了
[打印本页]
作者:
偏爱L
时间:
2018-4-24 15:20
标题:
预览时还没点击“登陆”按钮,音乐就想起来了,哪出问题了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>插入视频</title>
</head>
<style>
*{ padding:0; margin:0; font-family:"微软雅黑"; background-image:url(jquery%E6%A1%88%E4%BE%8B/images/a875e981f3f7473fbf49f04f31816d45.jpg)}
.btn{width:130px; height:30px; background:#06c; color:#fff; line-height:30px; cursor:pointer; text-align:center;}
.out{ height:400px; width:600px; background:#ccc; left:50%; top:50%; position:fixed; margin-left:-300px; margin-top:-200px; display:none; z-index:10}
.close{ width:30px; height:30px; font-size:20px; line-height:30px; background:#AAA; color:#fff; text-align:center; cursor:pointer; top:0; right:-30px; position:absolute}
.back{ width:100%; background:#000; height:100%; position:fixed; top:0; left:0; opacity:0.6; display:none; z-index:9}
</style>
<script src="jquery案例/js/jquery.min.js"></script>
<script>
$(function(){
var video=$(".out iframe").attr("src")
$(".btn").click(function(){
$(".out,.back").css("display","block")
$(".out iframe").attr("src",video)
})
$(".close").click(function(){
$(".out,.back").css("display","none")
$(".out iframe").attr("src","")
})
})
</script>
<body>
<div class="btn">登陆</div>
<div class="out">
<div class="close">×</div>
<iframe width="600" height="400" src="jquery案例/images/213b4b43750fc40c1be7bc6bb8e0d4df.mp4" frameborder="0" 'allowtfullscreen'></iframe>
</div>
<div class="back"></div>
<div style="height:1500px"></div>
</body>
</html
作者:
偏爱L
时间:
2018-4-24 15:22
打错字了,是“音乐响起来了”。不是把box隐藏了么,怎么还有声音啊
欢迎光临 论坛 (http://bbs.qinxue.com/)
Powered by Discuz! X3.1