如何在“ page-scroll-effects-master”导航菜单中添加jquery插件?

时间:2019-04-02 12:14:07

标签: javascript jquery html css

我希望插件具有菜单,您可以从中将页面插入到手中。

我尝试使用#遍历各个部分。

我认为jquery的代码是众所周知的,因为您可以找到该代码并添加菜单。

1 个答案:

答案 0 :(得分:0)

window.onscroll = function() {scrollFunction()};

function scrollFunction() {
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
    document.getElementById("myBtn").style.display = "block";
  } else {
    document.getElementById("myBtn").style.display = "none";
  }
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
}

相关问题