This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Vettalo

  • ***
  • 59 posts
Scroll to top when click next page in search page
« on: February 15, 2021, 01:33:29 PM »
hello,
i have ajax search enabled and when i click next page it keep waiting untill listings loads then it scroll to top.
so i would prefer to scroll to top when i immediately click next page before listings is loaded.
Best regards.

*

MB Themes

Re: Scroll to top when click next page in search page
« Reply #1 on: February 15, 2021, 02:35:19 PM »
@Vettalo
well such action should be done once content is available, otherwise we do not have all required data to do proper scroll. Screen could also have lags when scrolling to top at same time content is being loaded.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Vettalo

  • ***
  • 59 posts
Re: Scroll to top when click next page in search page
« Reply #2 on: February 15, 2021, 02:58:03 PM »
@Vettalo
well such action should be done once content is available, otherwise we do not have all required data to do proper scroll. Screen could also have lags when scrolling to top at same time content is being loaded.

check an example here https://www.subito.it/annunci-italia/vendita/usato/?from=top-bar
when you click next page it scroll to top immediately thats whats im trying to do

i have added in global.js

$(".paginate a").click(function() {
  $("html, body").animate({ scrollTop: 0 }, 100);
  return false;
});

but when i click next page it scroll to top but does not go to next page
best regards
« Last Edit: February 15, 2021, 03:01:51 PM by Vettalo »

Marked as best answer by Vettalo on February 15, 2021, 04:06:09 PM
*

MB Themes

Re: Scroll to top when click next page in search page
« Reply #3 on: February 15, 2021, 04:02:08 PM »
@Vettalo
Remove this line:
  return false;
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Vettalo

  • ***
  • 59 posts
Re: Scroll to top when click next page in search page
« Reply #4 on: February 15, 2021, 04:06:43 PM »
@Vettalo
Remove this line:
  return false;
thank you it works.
best regards.