简体   繁体   English

菜单悬停过渡效果从左到右CSS

[英]menu hover transition effect left to right css

I have used transition property to slide the mouse over background image from top to bottom. 我使用了transition属性,将鼠标从顶部到底部滑过背景图像。

css: CSS:

a {
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

How to change the transition effect from left to right? 如何从左到右改变过渡效果?

html: 的HTML:

<div class="a"></div>

css: CSS:

.a {
    background:url(http://a.static.trunity.net/images/132364/500x0/scale/butterfly-2.jpg) no-repeat;
    background-position:left top;
    display:block;
    width:400px;
    height:300px;
}

.a:hover {
    background-position:400px top;
    -webkit-transition:all 1s linear;
}

you can see it work on jsfiddle http://jsfiddle.net/bSyvP/1/ 您可以看到它在jsfiddle上正常工作http://jsfiddle.net/bSyvP/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM