How to count click about dblclick and do something after 4 clicks in jQuery?

杀马特。学长 韩版系。学妹 提交于 2020-08-20 11:13:40

问题


To letdoSetTag function take effect, before that and the first clicking(doule click, 2 clicks), some html elements will be highlight displayed, when user click button again(the second double-click, 4 clicks), then doSetTag(tagid); takes effect. Below colde takes effect at once double-click(2 clicks), so I would like to count the dbclick and let doSetTag(tagId) works after the second double-click(4 clicks).

$('#tagLabels .minitag-label').attr('title','Double-Click to cancel the tag').unbind().on('dblclick',function(){
    var labelid = $(this).data('id');
    var labelName = $(this).text();
        if (res.has(tagName) == 1){
            window.location.hash = "#resTags";
            setTimeout(function()
                {
                $(hash).css('background-color', '#D8CEC9').animate({
                    backgroundColor: '#00A087'
                }, 200);
                    doSetTag(tagid);
                },5000);
        }
})

来源:https://stackoverflow.com/questions/63422038/how-to-count-click-about-dblclick-and-do-something-after-4-clicks-in-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!