当我将鼠标放在按钮上时,如何检测按钮颜色是否因为css或javascript事件而发生变化?

时间:2022-07-01 21:05:47

How can I detect if color of bottom change because css or javascript event when i put mouse on button?

当我将鼠标放在按钮上时,如何检测底部的颜色是否因为css或javascript事件而改变?

My solution that not good enough:

我的解决方案不够好:

  1. create function that will listen to javascript events
  2. 创建将侦听javascript事件的函数

  3. check with firebug if element have css 'hover' rule
  4. 如果元素有css'悬停'规则,请检查firebug

Problems in my solution:

我的解决方案存在问题

  1. Can't detect which event happen before css or javascript

    无法检测css或javascript之前发生的事件

  2. Not Auto check

    不自动检查

Please give better solution if you have. (I working with JQUERY)

如果你有,请提供更好的解决方案。 (我和JQUERY合作)

Thanks, Yosef

1 个解决方案

#1


2  

You can check with Firebug which events are fired in JavaScript. Go to the Console and click "Profile". Then move your mouse over the button and you will see the JavaScript event show up.

您可以查看Firebug在JavaScript中触发哪些事件。转到控制台,然后单击“配置文件”。然后将鼠标移到按钮上,您将看到JavaScript事件显示。

#1


2  

You can check with Firebug which events are fired in JavaScript. Go to the Console and click "Profile". Then move your mouse over the button and you will see the JavaScript event show up.

您可以查看Firebug在JavaScript中触发哪些事件。转到控制台,然后单击“配置文件”。然后将鼠标移到按钮上,您将看到JavaScript事件显示。