Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #738509

    Hi,

    I wanted the shrinking header to go to 75% of the header height, so I changed divisor to 1.5 instead of 2 in file avia.js.

    However, it still shrinks to 50%, and then pops to 75%. How can this be fixed?

    Thanks!

    #738599

    the point is that it is not as simple as that.

    You must understand the code to get the values you need:

    https://kriesi.at/support/topic/reduce-sticky-header-size/#post-724020

    you have to change two values
    one for the scrolling distance
    an one for the amount of shrinking
    (only on that special case of 2 (50% shrink amount) the scroll distance and the scroll amount factors are identical =2))

    these are the values for the example : Starting at 220px shrinking to 95px
    because:
    because 220/1.76 = 125 =( 220-95) (that is the scroll distance when shrinking ends)
    and 220/2,31 = 95,23 ( good factor nearby 95 – to stay 2digits after komma)

    In words: After scrolling down 125px the end Header height is reached 95px (for that example)

    if(shrinking && !isMobile)
    {
        if(st < el_height/1.76)
        {
            newH = el_height - st;
            if(st <= 0){
    			newH = el_height;
    	    }
            av_change_class(header, 'remove', 'header-scrolled');
            //header.removeClass('header-scrolled');
        }
        else
        {
            newH = el_height/2.31;
            //header.addClass('header-scrolled');
            av_change_class(header, 'add', 'header-scrolled');
        }
    #738600

    please tell me your header start hight and the wanted end height

    another example Header start is 200px and the shrinked Header should end at 50px
    in words: after 150px scrolling ( =200px/1,33) the endheight of 50px ( =200/4) is reached.

    so first divisor is 1,33
    second divisor is 4

    if(st < el_height/1.33)
    .
    .
    .
    else
        {
            newH = el_height/4;
    .
    .
    .
    #739164

    Hey Guenni! Thank you very much! That’s right what I needed! Do you know how to make the transition smoother? It looks kind of bumpy when you scroll down. Thank you again!

    #739173

    i do not see your site – is there a link for us?

    #740266

    Hi,

    you could use different tools for WordPress to make your website faster. I would start with WP Super Cache and Better WP Minify Plugin.

    Best regards,
    Andy

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.