简体   繁体   English

如何删除jquery中的事件处理程序?

[英]how to remove an event handler in jquery?

I have to display a qTip when I click on the div .当我点击div时,我必须显示一个 qTip 。 But,that qTip is displayed when the mouse enters the div .但是,当鼠标进入div时会显示 qTip 。

I did not add any event except click .除了click之外,我没有添加任何事件。

On the first time the mouse enters it is not working, but the mouse over will activate after I click the div the first time.第一次鼠标进入时它不起作用,但是在我第一次单击div后鼠标悬停会激活。

After the first click on the div , if the mouse enters into the div that qTip is displayed, but I don't want to display the qTip while the mouse enters the div.第一次点击div ,如果鼠标进入显示 qTip 的 div,但我不想在鼠标进入 div 时显示 qTip。

My code is:我的代码是:

.on('click', '.selectionOptions', function(){
            $(this).qtip({
                id: 'selection_delete',
                style: {
                   classes: 'ui-component-config selectionOpt',
                   tip:false
                    },
                content:{
                        text:'HAI'
                    },
                show: {
                    event:'click'
                    }   
                },
                hide: {
                    when:'unfocus'
                }
            )};
        )};
$( "#foo" ).unbind();  

or或者

$( ".selectionOptions" ).click(function() {
    $( "body" )
    .off( "click", $(this), flash )
    .find( "#theone" )
      .text( "Does nothing..." );
    });

try this尝试这个

它应该是以下内容:

$(".element").off();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM