Jquery,如何在事件上更改鼠标光标 [英] Jquery, How to change the mouse cursor on an event

查看:136
本文介绍了Jquery,如何在事件上更改鼠标光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改事件上的鼠标指针,但它没有改变。调试器显示事件正在触发,但代码也没有任何问题,是否有任何问题?

  .top = $(' #rootDiv _' + root); 

.top.mouseenter( function (){
this .top.style.cursor = pointer;
});

解决方案

' #rootDiv _' + root);

.top.mouseenter( function (){
this .top.style.cursor = pointer;
});


哦!我在发布时找到了解决方案,但发布了问题以便为其他人提供解决方案。我只是在''mouseenter''事件中跟随''this'',发现''this''已经是div''top''。那我为什么要告诉''this''选择''top''。然后我废弃了''top'',最终的代码是:



  this  .top = 


' #rootDiv _' + root); // 将创建的div保存在最顶层。

this .top.mouseenter( function (){
this .style.cursor = 指针;
});


I want to change the mouse pointer on an event but it is not changing. Debugger shows that the event is firing but there is also not any problem with code there, is any?

this.top = $('#rootDiv_' + root);

this.top.mouseenter(function () {
            this.top.style.cursor = "pointer";
        });

解决方案

('#rootDiv_' + root); this.top.mouseenter(function () { this.top.style.cursor = "pointer"; });


Oh! I found the solution while posting it but post the question to give the solution others. I just followed ''this'' in ''mouseenter'' event and found that ''this'' is already the div ''top''. Then why should I tell ''this'' to select the ''top''. Then I obsolete the ''top'' and the final code is:

this.top =


('#rootDiv_' + root); //Saves the created div in top. this.top.mouseenter(function () { this.style.cursor = "pointer"; });


这篇关于Jquery,如何在事件上更改鼠标光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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