mouseover和mouseleave开/关不起作用 [英] mouseover and mouseleave ON / OFF Not Working

查看:134
本文介绍了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..!!

这篇关于mouseover和mouseleave开/关不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆