mouseover和mouseleave开/关不起作用

mouseover和mouseleave开/关不起作用

问题描述:

这是我在小提琴中的代码 http://jsfiddle.net/4yb42/10/

here is my code in fiddle http://jsfiddle.net/4yb42/10/

问题出在以下代码关闭mouseovermouseleave之后:

the problem is after off mouseoveror mouseleave by this code:

jQuery('.star-rating span').off('mouseover mouseleave');

如何打开或重新启动mouseovermouseleave ??

how to ON or start again effect of mouseoveror 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

工作小提琴

  1. 为每个事件定义函数,
  2. 使用of()
  3. 解除绑定
  4. 再次使用on()绑定这些功能.
  1. Defining function's for each event,
  2. unbinding them using of() and
  3. 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..!!