html - bootstrap 3 - 自动循环视频的悬停效果

标签 html css twitter-bootstrap

我正在尝试将悬停效果放在自动循环视频上,例如本网站 - http://campaign.mcdonalds.com.tw/McCafe/

this part of the website

在悬停之前,自动循环视频有一个叠加层。

悬停时,叠加层会消失,视频会放大一点。

如何实现这种悬停效果?

最佳答案

一些 CSS 魔法:

.vid-container {
  width:100px;
  height:100px;
  background:#c90;
  transition: all 0.5s ease-out;
  position:relative;
}

.vid-container::after {
  content: " ";
  width:100%;
  height:100%;
  background: rgba(0,0,0,0.5);
  position:absolute;
  top:0;
  left:0;
  transition: all 0.5s ease-out;
  pointer-events: none;
}


.vid-container:hover {
  transform: scale(1.2,1.2);
}

.vid-container:hover::after {
  opacity:0;
}
<div class="vid-container">
  Your video here
</div>

关于html - bootstrap 3 - 自动循环视频的悬停效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35338747/

相关文章:

html - 高度 :100%; doesn't show up

javascript - Fullcalendar:我应该定位哪个 css 选择器以在日历不可用时显示 'loading' 图像?

html - 创建 Web 组件时出错

html - css 溢出 'auto' 在边缘

html - 如何使用 HTML 和/或 CSS 使图像始终显示在某些关联文本的右侧?

jquery - Twitter-Bootstrap Modal on Modal 自定义关闭

html - 使用 Bootstrap 拉伸(stretch)图像和居中内容

CSS3 动画在 IE11 中不工作,但在其他浏览器中工作

javascript - jQuery removeClass 和 addClass

javascript - ng-click + ng-repeat 并尝试更改面板样式