更改onmouseover和onmouseout的转换时间? [英] Change transition time on onmouseover and onmouseout?

查看:107
本文介绍了更改onmouseover和onmouseout的转换时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的HTML

 < img class =logosrc =css / images / logo.png align =centeronmouseover =this.src ='css / images / logohov.png'onmouseout =this.src ='css / images / logo.png'> < / IMG> 

有没有办法改变过渡时间?我已经添加了转场:全部0.3s缓解;到类标志,但它没有做任何事情。



谢谢

我有幸添加了

  -webkit-transition:全部.3s缓入; 
-moz-transition:全部.3s缓和;
过渡:全部.3s缓和;

添加到我的css中,用于标签上的类,它影响onmouseover和onmouseout的转换时间(不使用任何:悬停CSS)。



为了让onmouseover和onmouseout生成标签内的文本,我不得不将链接的标签放在整个按钮的周围,而不是内部。

p>

希望有帮助!


This is my HTML

<img class="logo" src="css/images/logo.png" align="center"    onmouseover="this.src='css/images/logohov.png'" onmouseout="this.src='css/images/logo.png'"> </img>

Is there a way I can change the transition time? I've added transition:all 0.3s ease; to the class logo but it doesnt do anything.

Thanks

解决方案

I had luck just adding

-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;

to my css for a class on a tag and it effected the transition time for the onmouseover and onmouseout (not using any :hover css).

PS in order for the onmouseover and onmouseout to effect the text inside the tag I had to put the tag for my link around the entire button, instead of inside.

Hope that helps!

这篇关于更改onmouseover和onmouseout的转换时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆