Answer the question
In order to leave comments, you need to log in
Ajax loading of goods by the "Load more" button - how to remove the drop down?
Greetings.
The site is loading goods using the "Download more" button, after clicking it, everything loads perfectly, the goods are shown, but the screen jumps down to the level of the button itself, i.e. downloaded products remain at the top and you need to scroll up.
I can't figure out how to make the products load down and the screen doesn't twitch down.
Script attached: https://yadi.sk/d/iZ2M2EjQyhXGsw
Answer the question
In order to leave comments, you need to log in
I won't watch the script.
At the very beginning of the function of clicking on the "load more" button, you need to get a variable that calculates the height from the beginning of the page to the container with goods + the height of the container with goods, and in saxes scroll to these coordinates, roughly speaking like this:
var topoffset = $('.товарыблок').offset().top + $('.товарыблок').height();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question