Skip to content

Commit

Permalink
Merge pull request #5 from mike652638/mike652638-patch-5
Browse files Browse the repository at this point in the history
修复词条联想框出现在页面中央的BUG
  • Loading branch information
Mike Zheng authored Jun 12, 2017
2 parents 7667865 + ff694c4 commit 2d0a8a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions wiki/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,8 @@ $(document).ready(function() {
timeStart = Date.parse(new Date());
resultsSum = null;
resultNum = 0;
/**存在一个BUG: 主页搜索框输入文字会开启联想功能, 回车键同样会触发oninput事件, 下面是不得已的方法**/
setTimeout(function() {
$("#srchRelative").css("display", "none");
}, 1500);
/**存在一个BUG: 主页搜索框输入文字会开启联想功能, 回车键同样会触发oninput事件, 需要隐藏词条联想框**/
$("#srchRelative").css("display", "none");
if (isMainPage === "block") {
keyword = $("#srchIpt").val();
$("#kywdIpt").val(keyword);
Expand Down Expand Up @@ -321,6 +319,9 @@ $(document).ready(function() {
scrollTop = $(this).scrollTop(),
scrollHeight = $(document).height();

/**检测到页面滑动时词条联想框应该隐藏掉, 因为它是绝对定位的, 会出现在页面半中央位置, 碍眼睛**/
$("#srchRelative").css("display", "none");

if (isAutoLoad === "yes" && scrollHeight - scrollTop - windowHeight <= 200) {
if (hasExed === "no") {
//console.log("The scroll is now less than 200px above the bottom");
Expand Down

0 comments on commit 2d0a8a7

Please sign in to comment.