# easy-elements/1.2.9/widgets/scroll-to-top/js/scroll.js

Easy Elements for Elementor – Addons &amp; Website Templates, version 1.2.9. 25 lines.

- Page: https://pluginprobe.com/plugins/easy-elements/1.2.9/code/widgets/scroll-to-top/js/scroll.js
- Raw: https://pluginprobe.com/plugins/easy-elements/1.2.9/raw/widgets/scroll-to-top/js/scroll.js
- Modified: 2026-01-06T13:07:24+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/easy-elements/1.2.9/code/widgets/scroll-to-top/js/scroll.js#L10-L20`.

```javascript
(function($) {
    "use strict";
    $(document).ready(function(){
        var win=$(window);
        var totop = $('#easyel-top-to-bottom');    
        win.on('scroll', function() {
            if (win.scrollTop() > 150) {
                totop.fadeIn();
                $('header').addClass('eel-scoll-to-top');
                $('#easyel-top-to-bottom').addClass('eel-scroll-visible');  
            } else {
                totop.slideDown(400);
                $('header').removeClass('eel-scoll-to-top');
                $('#easyel-top-to-bottom').removeClass('eel-scroll-visible');
                
            }
        });
        totop.on('click', function() {
            $("html,body").animate({
                scrollTop: 0
            }, 500)
        }); 
    });
})(jQuery);

```
