Skip to Content

JavaScript File

URL: https://angradoheroismo.pt/wp-content/plugins/smooth-back-to-top-button/assets/js/smooth-back-to-top-button.js?ver=1.1.12
HTTP Status: 200 OK
MIME Type: application/javascript
Last Modified: Mon, 18 Sep 2023 09:00:51 GMT
Download Time: Less than a second
Cookies: None
Size: 2 KB
HTTP Headers:  13 headers
Links In:  1 pages
Links Out:  0 links
Images:  0 images
CSS:  0 files
JavaScript:  0 files
OK Issues: No issues found

1(function ($) {

2 "use strict";

3

4 jQuery(window).on('load', function () {

5

6 var progressPath = document.querySelector('.progress-wrap path');

7 var pathLength = progressPath.getTotalLength();

8

9 progressPath.style.transition = progressPath.style.WebkitTransition = 'none';

10 progressPath.style.strokeDasharray = pathLength + ' ' + pathLength;

11 progressPath.style.strokeDashoffset = pathLength;

12 progressPath.getBoundingClientRect();

13 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear';

14

15 var updateProgress = function () {

16 var scroll = jQuery(window).scrollTop();

17 var height = jQuery(document).height() - jQuery(window).height();

18 var progress = pathLength - (scroll * pathLength / height);

19 progressPath.style.strokeDashoffset = progress;

20 };

21

22 updateProgress();

23

24 jQuery(window).scroll(updateProgress);

25

26 });

27

28})(jQuery);