Q
添加视频
-1
A
回答
2
试试这个:
$(document).ready(function(){
$('.play').click(function() {
if($(this).parent().prev().get(0).paused){
$(this).parent().prev().get(0).play();
$(this).parent().prev().removeClass('blurEffect');
$('.content').hide();
}
});
$('.video').on('ended',function(){
$(this).addClass('blurEffect');
$('.content').show();
});
})
.wrapper {
position: relative;
display: inline-block;
}
.blurEffect {
-webkit-filter: blur(7px);
-o-filter: blur(7px);
-moz-filter: blur(7px);
-ms-filter: blur(7px);
filter: blur(7px);
}
.content {
position: absolute;
display: inline-block;
transform: translate(-50%,-50%);
top: 50%;
left: 50%;
color: #FFF;
width: 100%;
text-align: center;
z-index: 999;
}
.play {
font-size: 50px;
cursor: pointer;
border: 1px solid #FFF;
display: inline-block;
text-align: center;
padding: 5px 25px;
}
.play:hover {
color: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<div class="wrapper">
<video class="video blurEffect">
<source src=http://techslides.com/demos/sample-videos/small.webm type=video/webm>
<source src=http://techslides.com/demos/sample-videos/small.ogv type=video/ogg>
<source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4>
<source src=http://techslides.com/demos/sample-videos/small.3gp type=video/3gp>
</video>
<div class="content">
<div class="play">►</div>
<h1>Watch the movie</h1>
<p>Other text. Other text. Other text. Other text. </p>
</div>
</div>
1
-1
我已经创建了一个简单的Codepen文档,它将指向正确的方向。它只使用HTML和CSS元素,只用最少的代码。
它还使用称为模糊的CSS滤镜来模糊背景图像,并使用比例增加图像的大小以忽略模糊滤镜应用的白色边框。
HTML
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<div class="wrapper"></div>
<div class="center">
<i class="fa fa-play" aria-hidden="true"></i>
<h1>Watch the others</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit enean semper mattis elementum/</p>
</div>
CSS
body {
padding: 0;
margin: 0;
}
.wrapper {
position: fixed;
background: url(https://static.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg) no-repeat center center fixed;
background-size: cover;
width: 100%;
height: 100%;
filter: blur(10px);
transform: scale(1.1);
}
.center {
position: absolute;
text-align: center;
width: 100%;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 100%;
color: #fff
}
.center i {
font-size: 3em;
}
相关问题
- 1. 推广将视频添加到视频
- 2. jquery视频html5多个视频添加
- 3. drupal添加视频视频嵌入
- 4. php - 添加视频到php
- 5. jssor滑块添加视频
- 6. 将视频添加到Unity3d
- 7. Sitecore 8.1 MVC添加视频
- 8. 添加视频到网站
- 9. 如何添加Youtube视频
- 10. 用Jquery添加YouTube视频
- 11. 添加多个视频
- 12. 添加视频在ASP.NET C#
- 13. Actionscript 3添加视频admob
- 14. 添加一个Flash视频
- 15. 使用Sencha添加视频
- 16. 在MVC中添加视频
- 17. 添加视频弹出
- 18. 如何将音频添加到视频?
- 19. 将音频添加到视频文件
- 20. Windows视频 - 添加音频流到AVI
- 21. 将音频添加到ffmpeg视频流
- 22. FFMPEG添加音频到视频,但它夹到视频长度
- 23. 在视频上添加叠加
- 24. ffmpeg:我如何在视频-2的开头添加视频-1
- 25. Drupal视频模块为每个视频添加字段
- 26. 在ios视频顶部添加alpha视频
- 27. 视频图像:无法动态添加视频
- 28. 试图添加多个视频播放器和多个视频?
- 29. 添加视频链接和播放视频在我的网页
- 30. 如何以编程方式添加视频视频
请提供一个最小的,完整的和可验证的Example.please阅读本https://stackoverflow.com/help/mcve不提供任何图像或视频的外部链接 – core114