artemsemkin

Untitled

Oct 10th, 2020
592
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery('#your-button-id').on('click', () => {
  2.   if (typeof window.SB !== 'undefined') {
  3.     window.SB.scrollTo(0, 0, 800, { // 800 is duration in miliseconds
  4.       easing: (pos) => {
  5.         if (pos === 0) return 0;
  6.         if (pos === 1) return 1;
  7.         if ((pos /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (pos - 1));
  8.         return 0.5 * (-Math.pow(2, -10 * --pos) + 2);
  9.       }
  10.     });
  11.   }
  12. });
RAW Paste Data