【发布时间】:2021-05-13 10:48:49
【问题描述】:
我在按钮悬停时编写淡入和淡出文本...我必须在悬停时调用动画...我该怎么做?
const button = document.getElementById("btn");
const disp_text = document.getElementById('disp_text');
button.onmouseover = function(){
//Here goes the animation to play
disp_text.innerText = "Next";
}
我试过了:
const button = document.getElementById("btn");
const disp_text = document.getElementById('disp_text');
button.onmouseover = function(){
animation.Play("fadein");
disp_text.innerText = "Next";
}
但是什么都没有……
如果有人可以提供帮助,我将非常感激......
【问题讨论】:
-
这是从哪里来的:
animation.Play("fadein");?悬停时文本会改变吗?
标签: javascript jquery css-animations onmouseover