PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / v3 / src / assets / js / common / scrollElements.js
ameliabooking / v3 / src / assets / js / common Last commit date
appointments.js 1 year ago attendees.js 1 year ago colorManipulation.js 3 years ago customer.js 1 year ago date.js 1 year ago defaultCustomize.js 1 year ago employee.js 1 year ago events.js 1 year ago formFieldsTemplates.js 3 years ago formatting.js 1 year ago helper.js 1 year ago image.js 1 year ago integrationApple.js 1 year ago integrationGoogle.js 1 year ago integrationOutlook.js 1 year ago integrationStripe.js 1 year ago integrationZoom.js 1 year ago licence.js 2 years ago objectAndArrayManipulation.js 3 years ago pricing.js 1 year ago recurring.js 1 year ago responsive.js 1 year ago scrollElements.js 4 years ago settings.js 1 year ago translationsElementPlus.js 1 year ago
scrollElements.js
37 lines
1
2 function useScrollTo(elementContainer, elem, fromTop, duration, nested = {
3 inCollapse: false,
4 }) {
5 let start = elementContainer.scrollTop,
6 containerTop = elementContainer.offsetTop,
7 to = elem.offsetTop,
8 change = to - (start + containerTop + fromTop),
9 currentTime = 0,
10 increment = 20;
11
12 if (nested.inCollapse) {
13 change = (to + elem.offsetParent.offsetTop + elem.offsetParent.offsetParent.offsetTop + elem.offsetParent.offsetParent.offsetParent.offsetTop) - (start + containerTop + fromTop)
14 }
15
16 let animateScroll = function(){
17 currentTime += increment;
18 elementContainer.scrollTop = Math.easeInOutQuad(currentTime, start, change, duration);
19 if(currentTime < duration) {
20 setTimeout(animateScroll, increment);
21 }
22 };
23 animateScroll();
24 }
25
26 //t = current time
27 //b = start value
28 //c = change in value
29 //d = duration
30 Math.easeInOutQuad = function (t, b, c, d) {
31 t /= d/2;
32 if (t < 1) return c/2*t*t + b;
33 t--;
34 return -c/2 * (t*(t-2) - 1) + b;
35 };
36
37 export { useScrollTo }