mouseover和mouseleave开/关不起作用
这是我在小提琴中的代码 http://jsfiddle.net/4yb42/10/
here is my code in fiddle http://jsfiddle.net/4yb42/10/
问题出在以下代码关闭mouseover
或mouseleave
之后:
the problem is after off mouseover
or mouseleave
by this code:
jQuery('.star-rating span').off('mouseover mouseleave');
如何打开或重新启动mouseover
或mouseleave
??
how to ON or start again effect of mouseover
or mouseleave
??
在ClickMe1 ClickMe2 ClickMe3 ClickMe4 ClickMe4
上单击第一时间(转换为红色)然后单击重置"按钮后,它不起作用,现在将鼠标悬停在ClickMe1 ClickMe2 ClickMe3 ClickMe4 ClickMe4
上,其作用是将鼠标悬停在
it is not working after you click fist time on ClickMe1 ClickMe2 ClickMe3 ClickMe4 ClickMe4
(the convert in to red color) then click on reset button , and now mouse over on ClickMe1 ClickMe2 ClickMe3 ClickMe4 ClickMe4
its on effect on mouse over
- 为每个事件定义函数,
- 使用
of()
和 解除绑定
- 再次使用
on()
绑定这些功能.
- Defining function's for each event,
- unbinding them using
of()
and - again binding those functions using
on()
.
代码
jQuery('.star-rating span').on({
mouseenter: function () {
me(this);
},
mouseleave: function () {
ml(this);
},
click: function () {
cl(this);
}
});
希望它会有所帮助.. !!
Hope it helps..!!