Problem on Safari - Hide Header on Scroll Down & Show on Scroll Up

33
October 12, 2021, at 02:50 AM

It works on Chrome and other browsers but does not work on Safari

<script>
  var lastScrollTop = 0;
  var navbar = document.getElementById("navbar");
  window.addEventListener("scroll", function(){
  var scrollTop = window.pageYOffset || 
   document.documentElement.scrollTop;
  if (scrollTop > lastScrollTop){
   navbar.style.top="0px";
  }else{
   navbar.style.top="-120px";
  }
  lastScrollTop = scrollTop;
})
READ ALSO
Can I unarchive .aar, then change string resources and archive back?

Can I unarchive .aar, then change string resources and archive back?

I have aaar library file and want to change the string value in res/values

39
MySQLdb.cursor.execute can&#39;t run multiple queries

MySQLdb.cursor.execute can't run multiple queries

We're trying to run SQL files containing multiple insert statements as a single query, but it seems rollback fails when any of the statements contain an error

63
java.lang.ClassNotFoundException HOW DO I SOLVE THIS [closed]

java.lang.ClassNotFoundException HOW DO I SOLVE THIS [closed]

Want to improve this question? Add details and clarify the problem by editing this post

35
How to unwind Object of Array in Mongodb

How to unwind Object of Array in Mongodb

I am trying to manipulate a dataset to make it easy to display in mongoChartsThere are two sets of team_a and team_b, each contains a set of playerId, score, rank, and prize

69