Okay
  Public Ticket #1283829
Sticky object affected by header banner
Closed

Comments

  • Brandon Rottmayer started the conversation

    Hello,

    I have set up ads on these pages (within the California theme) to stick at the top while you scroll down the page. But when you scroll back up, it gets hidden by the header banner. Is there a way to adjust the sticky to move down with the banner?

    Sticky code:

    .sticky-image {
    position: -webkit-sticky;
    position: sticky;
    top: 15px;
    z-index: 1000;}

    Thanks,
    Brandon.

  •  1,801
    Support replied

    I can't find your sticky-image class, but if you are reffering to the banner, you need to add more padding to top.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Brandon Rottmayer replied

    Thanks for getting back. I had changed the sticky class and forgot I gave you the wrong one:

    .ad-space {
    position: -webkit-sticky;
    position: sticky;
    top: 15px;
    z-index: 1000;
    }

    If I add more padding, then that might be odd when scrolling down when the header is hidden. Is there a way to add the extra padding only when the header is shown when you scroll up?

    Thanks,
    Brandon.

  •  1,801
    Support replied

    Hi Brandon,

    A solution we found is to increase the padding top to 100px in the vc row with the ad-space class.

    To move the banner with the menu requires js custom work.



    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Brandon Rottmayer replied

    I figured it has to do with custom javascript work. Is there a starting point that you can point me toward? I am unsure exactly which js is controlling the header to show and hide.

    Thanks,
    Brandon.

  •  1,801
    Support replied

    Hello Brandon,

    if you open /js/scripts.js look for the following functions:

    function HideShowHeader() (adds 'nav-hide' class to the header when scrolling down)

    function HeaderHeight() - header height classes function of current scrolling value

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Brandon Rottmayer replied

    OK, I am running up on a deadline and I cannot figure this out. How can I simply prevent the header from hiding when scrolling? I will have to take this action first while I figure out how to adjust the javascript files to accomplish what I want it to do.

    Thanks,
    Brandon.

  •  1,801
    Support replied

    To disable header hiding please add this in Theme Options > Custom CSS:


    header.nav-hide {
        top: 0 !important;
    }

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Brandon Rottmayer replied

    Thank you, that worked.

    Brandon.