Jump to content
Vilius PromoApranga

After next page - go to top

Recommended Posts

Hi,

 

me too, it's tedious to have to scroll manually on page change...

I'm looking for a solution to that, but without success by now.

Share this post


Link to post
Share on other sites

Hi, 

 

Try this 

  $( '#products' ).on( 'click', '.js-search-link', function( event ) {
    var target = $( "#header" );
    if ( target.length ) {
      event.preventDefault();
      $( 'html, body' ).animate( {
        scrollTop: target.offset().top+300
      }, 1000 );
    }
  });
  • Thanks 2

Share this post


Link to post
Share on other sites

Hi, I'm having same issue.

Where to to put you suggested code?

 

Thanks!

 

 

Hi, 

 

Try this 

  $( '#products' ).on( 'click', '.js-search-link', function( event ) {
    var target = $( "#header" );
    if ( target.length ) {
      event.preventDefault();
      $( 'html, body' ).animate( {
        scrollTop: target.offset().top+300
      }, 1000 );
    }
  });

Share this post


Link to post
Share on other sites

Im new prestashop 1.7.2.2 this feature is in stock.

 

Give me address your shop. i will try make compabilty code

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

how could I fix the same issue in 1.7.1.1? Can I use the same code?

Didn't understand where to put it in /themes/core.js ... at the bottom?

Thanks

Share this post


Link to post
Share on other sites
13 hours ago, illycoffee said:

Hi,

how could I fix the same issue in 1.7.1.1? Can I use the same code?

Didn't understand where to put it in /themes/core.js ... at the bottom?

Thanks

 

Yep just copy paste it to the very bottom, that's what did it for me. 

Share this post


Link to post
Share on other sites

In PS 1.7.6 it might be this:

$(document).ready(() => {
  prestashop.on('updateProductList', () => {
    let target = $("#wrapper");
    if (target.length) {
      $('html, body').animate({
        scrollTop: target.offset().top
      }, 0);
    }
  });
});

 

This is taken from @Loboo's solutuon, but I scroll to #wrapper without animation time.

Share this post


Link to post
Share on other sites
On 11/12/2019 at 6:21 PM, Flower7C3 said:

In PS 1.7.6 it might be this:


$(document).ready(() => {
  prestashop.on('updateProductList', () => {
    let target = $("#wrapper");
    if (target.length) {
      $('html, body').animate({
        scrollTop: target.offset().top
      }, 0);
    }
  });
});

 

This is taken from @Loboo's solutuon, but I scroll to #wrapper without animation time.

Don't work with my prestacrea theme... Is it just for default theme ?

Share this post


Link to post
Share on other sites
19 hours ago, Jean Francois G said:

Don't work with my prestacrea theme... Is it just for default theme ?

It works on my custom theme. You have check if updateProductList event and target element exists in Your code.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More