JavaScript OnMouseDown 图像悬停效果帮助
这就是我制作的秒表(您可以此处查看)。
但是,当您尝试时,您会发现存在一些问题,而我想要实现的是...
当我将鼠标悬停在开始按钮上时,它会显示翻转,但是当我单击时,会出现停止按钮,并且当鼠标按钮抬起,停止按钮翻转/悬停图像出现。
它会按照我想要的方式进行操作,但是当您将鼠标悬停在秒表上时,时间即将过去,当我希望保留停止按钮时,就会出现开始按钮。
此外,当时间过去,光标仍然在停止按钮上时,一旦再次按下它,而不是显示开始按钮,就像我希望它仍然显示停止按钮一样。
现在我知道我必须使用 If 和 Else If 语句来实现这一点,但是我不知道如何让它发挥作用。 (我花了近 3 个小时试图找到答案,今天一整天都在享受内心的金发时刻)
任何人都可以帮忙吗?
So here's the thing I made a stopwatch (that you can view here).
However when you try it out you'll see there's some problems, and what I'm trying to achieve is...
When I hover over the start button, it's rollover shows, but when I click down the stop button appears, and when the mouse button is up the stop buttons rollover/hover image appears.
In which it does what I want it to there, but when you hover off the stopwatch when the time is going the start button appears when I want the stop button to remain.
Additionally, when the time is going, and the cursor is still on the stop button, once it's pressed again instead of showing the start button, like I want it still shows the stop button.
Now I know I haft to use the If, and Else If statements with this however I'm unaware on how to get this to work. (I've spent almost 3 hours trying to find the answer, and just having a inner blonde moment today all day)
Can anybody help???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this :