如何解决jQuery Show闪烁
<html>
<head>
<script type=\"text/javascript\">
var oauth = chrome.extension.getBackgroundPage().oauth;
</script>
<style type=\"text/css\">
#note
{
display:none;
}
</style>
<script src=\"Task.js\" type=\"text/javascript\"></script>
<script src=\"Taskhandle.js\" type=\"text/javascript\"></script>
<script src=\"jquery.js\" type=\"text/javascript\"></script>
<title>TaskMan</title>
</head>
<body>
<input type=\"text\" id=\"title\"><input type=\"text\" id=\"note\">
<a href=\"\" id=\"make\" onclick=\"maketask()\">+</a> <a href=\"\" id=\"anote\">N</a>
<script type=\"text/javascript\">
window.onload=function(){
$(\'#anote\').click(function () {
$(\'#note\').show();
});
}
</script>
</body>
</html>
当我在chrome中运行此代码时,输入闪烁。我需要解决。
解决方法
您必须防止默认链接(正在重新加载页面):
$(\'#anote\').click(function (E) {
E.preventdefault();
$(\'#note\').show();
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。