如何在淡入淡出过渡之前使旋转木马图像稍微变焦

时间:2015-04-20 04:06:00

标签: css twitter-bootstrap

我正在为一个班级建立一个网站,我喜欢网页www.sweetgreen.com,他们的图像似乎在淡入淡出过渡之前稍微放大。我得到了褪色,但它很快,并没有优雅地做到这一点。虽然我可能想到这一点,轻微的缩放效果是我想知道怎么做,我已经检查了元素并在我的bootstrap样式表中为我的rails应用程序应用了一些具有特定功能的类。这是我的div

 `<div class="item">
     <%= link_to image_tag("carousel_img2.jpeg", :size => "1600x200", :alt =>
     "Slide2"), {:class => "img-responsive center-block", :alt => "Responsive  
      image"} %>
      <div class="carousel-caption text-center">

        </div>

2 个答案:

答案 0 :(得分:1)

我做了一个明确的演示:https://jsfiddle.net/wyvguf25/

这个基于Bootstrap3:https://jsfiddle.net/q0rgL8ws/

第一个使用opacity。 对于正在使用display

的Bootstrap

答案 1 :(得分:0)

@-webkit-keyframes move {
from {
transform: scale(1, 1);
-ms-transform: scale(1, 1); /* IE 9 */
-webkit-transform: scale(1, 1); /* Safari and Chrome */
-o-transform: scale(1, 1); /* Opera */
-moz-transform: scale(1, 1); /* Firefox */
}
to {
transform: scale(1.05, 1.05);
-ms-transform: scalescale(1.05, 1.05); /* IE 9 */
-webkit-transform: scalescale(1.05, 1.05); /* Safari and Chrome */
-o-transform: scalescale(1.05, 1.05); /* Opera */
-moz-transform: scale(1.05, 1.05);/* Firefox */

}
}
.item .zoomin {
animation:move 7s ease infinite; 
-ms-animation:move 7s ease infinite;
-webkit-animation:move 7s ease infinite;
-0-animation:move 7s ease infinite;
-moz-animation:move 7s ease infinite;
background-color:Black;
left:-150px;
top:-150px;
}

它使用第一个也具有缩放效果的滑块。

相关问题