# bit-form/2.10.1/assets/scrollToElm.min.js

Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator &amp; Custom Form Builder, version 2.10.1. 2 lines.

- Page: https://pluginprobe.com/plugins/bit-form/2.10.1/code/assets/scrollToElm.min.js
- Raw: https://pluginprobe.com/plugins/bit-form/2.10.1/raw/assets/scrollToElm.min.js
- Modified: 2023-12-16T11:37:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bit-form/2.10.1/code/assets/scrollToElm.min.js#L10-L20`.

```javascript
var scrollToElm=function(){"use strict";const t=function(t){(function(t,e=10){const n=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth;return n.top>=e&&n.left>=e&&n.bottom<=o-e&&n.right<=i-e})(t)||(function(t){let e=t.parentElement;for(;e&&e!==document.body;){if(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth){e.scrollIntoView({behavior:"smooth"});break}e=e.parentElement}}(t),t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}))},e=function(t,e){let n;const o=function(...e){clearTimeout(n),n=setTimeout((()=>t(...e)),300)};return o.cancel=function(){clearTimeout(n)},o}(t);return function(n,{immediate:o=!1}={}){e.cancel(),o?t(n):e(n)}}();

```
