css如何用ease in out,离开悬停状态CSS3时轻松一下(Ease out on when leaving hover state CSS3)...
离开悬停状态CSS3时轻松一下(Ease out on when leaving hover state CSS3)
另一个CSS3问题。 我设法在悬停时旋转(360)图像,但是当它离开悬停状态时它保持它的速度。 理想情况下,我正在寻找一种解决方案,以便在离开悬停状态时减慢速度。 我知道有一个属性(缓解)来实现这一点,但我似乎无法找到一个有效的解决方案。 经过多次尝试,我希望得到一些指示。
标记:
WelcomeTerry Wingfield
样式:
.my-image
{
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
-o-transition-duration: 0.8s;
transition-duration: 0.8s;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
transition-property: transform;
}
.my-image:hover
{
-webkit-transform:rotate(360deg);
-moz-transform:rotate(360deg);
-o-transform:rotate(360deg);
}
我把它剥离回原来的样子。 任何帮助将不胜感激,并且非常欢迎将上述样式重写为速记的想法。
问候,
Another CSS3 question. I have managed to rotate(360) an image on hover but it retains it's speed when leaving the hovered state. Ideally I'm looking for a solution to slow the speed when leaving the hovered state. I know there's a property(ease-out) to achieve this but I can't seem to get a working solution. After many attempts, I was hoping to get some pointers.
Markup:
WelcomeTerry Wingfield
Styles:
.my-image
{
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
-o-transition-duration: 0.8s;
transition-duration: 0.8s;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
transition-property: transform;
}
.my-image:hover
{
-webkit-transform:rotate(360deg);
-moz-transform:rotate(360deg);
-o-transform:rotate(360deg);
}
I have stripped it back to what I originally had. Any help would be appreciated and thoughts on re-writing the styles above to shorthand would be very welcome.
Regards,
原文:https://stackoverflow.com/questions/26956897
更新时间:2020-09-05 09:09
最满意答案
阅读这篇很棒的文章。 您将代码放在.my-image以hover off (mouseleave)过渡。 并.my-image:hover你将你的代码放在.my-image:hover 。
所以你的最终代码是:
.my-image {
/* Slower transition off hover */
-webkit-transition-duration: 1s;
-moz-transition-duration: 1s;
-o-transition-duration: 1s;
transition-duration: 1s;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
transition-property: transform;
}
.my-image:hover {
/* Faster transition on hover */
-webkit-transition-duration: 0.5s;
-moz-transition-duration: 0.5s;
-o-transition-duration: 0.5s;
transition-duration: 0.5s;
-webkit-transform:rotate(360deg);
-moz-transform:rotate(360deg);
-o-transform:rotate(360deg);
transform:rotate(360def);
}
我希望这有效。
Read this awesome article. You put your code in .my-image for hover off (mouseleave) transitions. And for hover on you put your code in .my-image:hover.
So your final code would be:
.my-image {
/* Slower transition off hover */
-webkit-transition-duration: 1s;
-moz-transition-duration: 1s;
-o-transition-duration: 1s;
transition-duration: 1s;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
transition-property: transform;
}
.my-image:hover {
/* Faster transition on hover */
-webkit-transition-duration: 0.5s;
-moz-transition-duration: 0.5s;
-o-transition-duration: 0.5s;
transition-duration: 0.5s;
-webkit-transform:rotate(360deg);
-moz-transform:rotate(360deg);
-o-transform:rotate(360deg);
transform:rotate(360def);
}
I hope this works.
相关问答
你不需要任何js代码来做到这一点。 使用:hover pseudoclass代替: #div-right{
display: inline-block;
/*border added for debug purpose*/
border: 1px solid rgba(0,0,0,0.1);
width: auto;
}
#div-right:hover>a{
font-size: 30px;
color: black;
font-weight:
...
我建议将事件移动到链接,所以根据http://jsfiddle.net/9jMqc/2/移动它们 .tunein a {
display: block;
-webkit-transform:rotate(12deg);
-moz-transform:rotate(12deg);
}
.tunein a:hover{
animation: rotate 0.5s ease-out;
-moz-animation:rotate 0.5s
...
出现此问题的原因是您将鼠标悬停在动画元素上。 旋转发生时,鼠标悬停的元素会改变其大小。 结果:在短时间内光标不再处于悬停位置。 (自己看,为图标设置一个彩色边框并将其悬停)。 如果鼠标不能保持完全不动的话,这将随后重置事件... 为避免这种情况,请将图标设置在容器中,并在容器悬停时执行动画。 HTML / CSS .wrapper:hover .fa-stack{
color: red;
transition: 0.9s;
transform: rotateY(180
...
CSS转换更清晰: .fadeInUp {
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-o-transition: all 300ms ease;
-ms-transition: all 300ms ease;
transition: all 300ms ease;
-webkit-transform: tran
...
阅读这篇很棒的文章。 您将代码放在.my-image以hover off (mouseleave)过渡。 并.my-image:hover你将你的代码放在.my-image:hover 。 所以你的最终代码是: .my-image {
/* Slower transition off hover */
-webkit-transition-duration: 1s;
-moz-transition-duration: 1s;
-o-transiti
...
感谢@Nikki,我可以找到一个解决方案。 使用JS,我可以在DOM完全加载时调用此函数,这样我强制css启动。 var listdot = document.getElementByClassName("dot");
function Start() {
for (var i = 0; i < listdot.length; i++) {
listdot[i].style.WebkitAnimation = "example";
}
}
Thanks to @N
...
menu li ul li a:hover {
width: 220px;
}
将上面的类添加到CSS.Hope上面的代码工作 menu li ul li a:hover {
width: 220px;
}
Add the above class to CSS.Hope the above code works
您需要为宽度设置动画。 无需使用关键帧来执行此操作,只需在悬停中添加新参数,并添加到平滑动画的过渡 mark {
background-color: transparent;
}
a span.visual ,
a span.merchandising {
display: inline-block;
width:0;
opacity: 0;
-webkit-transition: all 0.4s linear; /* Safari */
tra
...
关键帧设置的规则似乎在级联中具有更高的重要性。 我不确定这是否应该如此,但@media规则具有最高的重要性。 @keyframes也应该太或这是一个错误。 级联规范没有具体提及它们。 而不是使用pause ,您可以完全删除动画。 #box a:hover {-webkit-animation: none;color:red; font-size: 50px;}
http://jsfiddle.net/rvBS2/1/ Rules set by the keyframe seem to have
...
您需要添加动画延迟以允许转换完成,因为它会在动画开始时恢复到scale(.7) 。 更新了jsFiddle -webkit-animation-delay:1s;
编辑 我意识到我在这里发布的答案并不完全正确。 确实,延迟动画了从大回到小回的过渡,但是如果你在它的扩展时将其悬停在脉冲球上,它会在动画到大规模之前跳回到它的0值.7。 更新了演示 我提出了一个修复程序,只是使用一些JavaScript来修复它基于这篇文章 。 你必须稍微改变一下CSS,但结果并不是很明显。 这是更新的代码 /* CS
...
css如何用ease in out,离开悬停状态CSS3时轻松一下(Ease out on when leaving hover state CSS3)...相关推荐
- 请参阅:Chrome开发者工具中的悬停状态
我希望看到:hover我在Chrome中徘徊的锚点的:hover样式. 在Firebug中,有一个样式下拉列表,允许我为元素选择不同的状态. 我似乎无法在Chrome中找到类似内容. 我错过了什么吗? ...
- [css] 如何用css实现把“我不爱996”变成“699爱不我”?
[css] 如何用css实现把"我不爱996"变成"699爱不我"? unicode-bidi 属性与 direction 属性一起使用,来设置或返回文本是否被 ...
- CSS 如何用border绘制三角形、等腰梯形、直角梯形
CSS 如何用border绘制三角形.等腰梯形.直角梯形 border 有宽度后,四角交接处会产生斜线,可根据此原理绘制三角形.等腰梯形.直角梯形等图形. div {width: 50px;heigh ...
- 鼠标悬停字体抖动_快速提示:解决悬停状态下的字体粗细问题
鼠标悬停字体抖动 Have you ever tried to change the value of the font-weight property on link states? If yes, ...
- rp原型中鼠标悬停显示图片_悬停状态原型4种方式
rp原型中鼠标悬停显示图片 There are tons of options available for UX designers to prototype a user experience an ...
- 62套儿童行业响应式Html5儿童慈善机构网站模板儿童公益组织企业官网模板儿童慈善CSS模板下载婴儿树儿童健康食品整站模板html5网页静态模板Bootstrap扁平化网站源码css3手机seo自适响
62套儿童行业响应式Html5儿童慈善机构网站模板儿童公益组织企业官网模板儿童慈善CSS模板下载婴儿树儿童健康食品整站模板html5网页静态模板Bootstrap扁平化网站源码css3手机seo自适响 ...
- java中循环输入_如何用java循环输入并且当输入0时结束循环?
如何用java循环输入并且当输入0时结束循环? import java.util.Scanner; public class Avg { public static void main(String[ ...
- html5页面中鼠标悬停效果,CSS实例:非常不错的鼠标悬停TIP效果!_div+css布局教程...
在实际开发中,我们会给图片加上alt.给链接加上title,为了出故障预备,也可以提醒用户的内容是什么,或仅仅是tip提示.今天我们介绍一款不错的鼠标悬停TIP效果,图片如下: 这样的效果在实际开发中 ...
- HTML中设置鼠标悬停状态伪类,四大伪类,css鼠标样式设置,reset操作,静止对文本操作...
本文将要为您介绍的是四大伪类,css鼠标样式设置,reset操作,静止对文本操作,教程操作方法:07.31自我总结 一.a标签的四大伪类 a:link{样式} 未访问时的状态(鼠标点击前显示的状态) ...
最新文章
- Task On The Board CodeForces - 1367D(思维)
- hadoop3.2.2--记录java.io.IOException: All specified directories have failed to load.问题
- Apache Kudu 加速对频繁更新数据的分析
- python库的学习系列之 13.2. ConfigParser — Configuration file parser
- Laravel源码解析之中间件
- silverlight体验之三:简单控件堆成个Login
- 对此人的嚣张你们怎么看
- JMeter压力测试步骤
- 简单解析一下,实施MES管理系统后有哪些效益
- KGB知识图谱通过数据可视化提升金融行业分析能力
- android6 存储卡异常,手机SD卡无法读取时,如何在手机上修复损坏的SD卡?
- 使用bootstrap实现freeCodeCamp上Build a Personal Portfolio Webpage
- java swing 简单计算器_java用swing写了一个简单的计算器
- 淮阴工学院计算机科学讲师,淮阴工学院计算机与软件工程学院统战人士工作业绩...
- Docker——入门实战
- 36岁程序员2023年第一天上班被裁
- 使用Objective C建立UUID
- 简明 CSS2.1 参考手册
- Centos7安装trojan脚本
- 声网把七年无全网事故的实时传输网络SD-RTN全面开放了——这就是FPA
热门文章
- mysql状态监控_mysql 状态监控
- 定位服务器已关闭里面显示的时间,测试显示iPhone关闭定位服务仍记录用户位置...
- 导出oracle dblink,expdp 只导出dblink
- 对ACM初学者的意见及推荐ACMer看的书 - 孟起 - 博客园
- oracle表关联词语,Oracle的同义词(synonyms)详解
- arcgis属性表模糊查询
- R语言读取csv文件,第一列列名出现乱码的解决方法
- 艾迪康通过上市聆讯:曾靠疫情检测两年赚20亿 凯雷为大股东
- java实现细胞自动机
- python链表的建立