Internal anchor smooth scroll

Internal URL smooth scroll from menu – anchor link:

        $("a[href*=#]:not([href=#])").click(function() {
            var kliknjeno = $(this);

            var calapse_mobile = kliknjeno.parent().parent().parent().parent();

            if (calapse_mobile.hasClass('collapse')) {
                calapse_mobile.collapse('hide');
            }

            if (!kliknjeno.hasClass( "nohref" )) {
                if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname) {
                    var a = $(this.hash);
                    if (a = a.length ? a : $("[name=" + this.hash.slice(1) + "]"), a.length) return $("html,body").animate({
                        scrollTop: a.offset().top - 30
                    }, 1000), !1
                }
            }

        })

To Top Button

Scroll to top Button

    if ($('#back-to-top').length) {
        var scrollTrigger = 300, // px
            backToTop = function () {
                var scrollTop = $(window).scrollTop();
                if (scrollTop > scrollTrigger) {
                    $('#back-to-top').addClass('show');
                } else {
                    $('#back-to-top').removeClass('show');
                }
            };
        backToTop();
        $(window).on('scroll', function () {
            backToTop();
        });
        $('#back-to-top').on('click', function (e) {
            e.preventDefault();
            $('html,body').animate({
                scrollTop: 0
            }, 700);
        });
    }