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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -