Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/449.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在除超链接/输入按钮之外的所有对象上使用Jquery模糊触发器_Javascript_Jquery - Fatal编程技术网

Javascript 如何在除超链接/输入按钮之外的所有对象上使用Jquery模糊触发器

Javascript 如何在除超链接/输入按钮之外的所有对象上使用Jquery模糊触发器,javascript,jquery,Javascript,Jquery,要让jquery操作在理想情况下运行,我遇到了一个小问题。目前,在一个名为“person_email”的特定字段的模糊图像上,一切都正常工作。问题是,如果最终用户这样做,并决定单击jquery从blur触发的页面其余部分上的超链接,那么用户会短暂地看到这一点,然后继续到相应的链接 理想情况下,只有在未单击超链接时才会触发模糊 var $email = $("#person_email"); var $hint = $("#hint_edit"); $email.on('blur',functi

要让jquery操作在理想情况下运行,我遇到了一个小问题。目前,在一个名为“person_email”的特定字段的模糊图像上,一切都正常工作。问题是,如果最终用户这样做,并决定单击jquery从blur触发的页面其余部分上的超链接,那么用户会短暂地看到这一点,然后继续到相应的链接

理想情况下,只有在未单击超链接时才会触发模糊

var $email = $("#person_email");
var $hint = $("#hint_edit");

$email.on('blur',function() {
  $hint.hide; // Hide the hint
  $(this).mailcheck({
    suggested: function(element, suggestion) {
        // First error - Fill in/show entire hint element
        var suggestion = "Did you mean: <span class='suggestion'>" +
                         "<span class='address'>" + "</span>" +
                         "<a href='#' class='domain'>" + suggestion.address +
                         "@" + suggestion.domain + "</a></span>?";

        $hint.html(suggestion).fadeIn(150);
    }
  });
});

 $hint.on('click', '.domain', function() {
  // On click, fill in the field with the suggestion and remove the hint
  $email.val($(".suggestion").text());
  $hint.fadeOut(200, function() {
    $(this).empty();
  });
  return false;
 });
})
var$email=$(“个人电子邮件”);
var$hint=$(“#hint_edit”);
$email.on('blur',function(){
$hint.hide;//隐藏提示
$(此)。邮件检查({
建议:功能(要素、建议){
//第一个错误-填写/显示整个提示元素
var suggestion=“你的意思是:+
"" + "" +
"?";
$hint.html(建议).fadeIn(150);
}
});
});
$hint.on('click','.domain',function(){
//单击后,在字段中填入建议并删除提示
$email.val($(“.suggestion”).text());
$hint.fadeOut(200,函数(){
$(this.empty();
});
返回false;
});
})
我想你想要

$("a").on("click",function() {
  $email.off();
});