Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • orsomannaro Friend
    #892165

    I don’t like the fixed header and menu neither the scroll animation.

    To have relative header and menu position I put this rules in custom.css :

    .t3-wrapper {
        padding-top: 10px;
    }
    .t3-header{
        position: relative !important;
    }
    .t3-mainnav {
        position: relative !important;
        padding-top: 0;
    }

    But I still can see the animation effect when I scroll the page.

    How can I disable this animation at all?

    Thank you.

    Ninja Lead Moderator
    #892694

    Hi,

    You can try with my tweak below to achieve that.

    Open templates/ja_magz_ii/js/script.js file, find and remove this script

    // Header Scroll
    // -----------------
    (function($) {
    
        var scrollLastPos = 0,
            scrollDir = 0, // -1: up, 1: down
            scrollTimeout = 0;
        $(window).on ('scroll', function (e) {
            var st = $(this).scrollTop();
            //Determines up-or-down scrolling
            if (st < 80) {
                if (scrollDir != 0) {
                    scrollDir = 0;
                    scrollToggle();
                }
            } else if (st > scrollLastPos){
                //Replace this with your function call for downward-scrolling
                if (scrollDir != 1) {
                    scrollDir = 1;
                    scrollToggle();
                }
            } else if (st < scrollLastPos){
                //Replace this with your function call for upward-scrolling
                if (scrollDir != -1) {
                    scrollDir = -1;
                    scrollToggle();
                }
            }
            //Updates scroll position
            scrollLastPos = st;
        });
    
        $('.ja-header').on ('hover', function () {
            $('html').removeClass ('scrollDown scrollUp').addClass ('hover');
            scrollDir = 0;
        })
    
        scrollToggle = function () {
            $('html').removeClass ('hover');
            if (scrollDir == 1) {
                $('html').addClass ('scrollDown').removeClass ('scrollUp');
                $("#t3-header").css('top','0px');
            } else if (scrollDir == -1) {
                $('html').addClass ('scrollUp').removeClass ('scrollDown');
                $("#t3-header").css('top','0px');
            } else {
                $('html').removeClass ('scrollUp scrollDown');
                $("#t3-header").css('top','51px');
            }
            $('html').addClass ('animating');
            setTimeout(function(){ $('html').removeClass ('animating'); }, 1000);
        }
    
    })(jQuery);

    Hope it helps

    Regards

    orsomannaro Friend
    #892865

    It works!

    Out of curiosity: is it possible to solve the problem with custom.css?

    Ninja Lead Moderator
    #893211

    Yes, you can redefine scrollDown, scrollUp and animating class from custom.css file but the best way, you need to change directly from templates/ja_magz_ii/js/script.js file as my solution.

    orsomannaro Friend
    #893370

    Thank you again

    bohemiadesign Friend
    #990006

    Thank you – this is what I was after as well.
    However – if the template has an update in the future it migh overwrite the script.js file.
    Is it possible to ‘copy’ the script.js file to my theme folder – tomake sure the chnages are not overwritten?
    Thanks
    J

    Ninja Lead Moderator
    #990154

    @bohemiadesign: In this case, you need to make a backup all files have been changed on your site and process upgrading on your site.

Viewing 7 posts - 1 through 7 (of 7 total)

This topic contains 6 replies, has 3 voices, and was last updated by  Ninja Lead 7 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum