jquery - stop window scroll animation -
Anyone can help me here, I need this function to be closed at the top: -70px; Also, when you click it any time after closing it will open back, but I think I can do that part, the main question is that when I reach, the function prevents - 70px
$ (window) .scroll (function () {var topMove = -1 * (620 * $ (this) .scrollTop () / $ ('body'). Height ()) ; $ ('.nav') CSS ({top: Math Max (Topmove)}}});
Thank you!
Is it after you?
I had to add console.log (topMove) to see what your variable was producing. In fact, it was a negative value. I then added the following to run only when the topMove is greater than or equal to -70 . if (topMove> = -70) {$ ('. NAV'). CSS ({top: Math.Max (headmistress)}); }
Comments
Post a Comment