• Resolved mwarbinek

    (@mwarbinek)


    Currently, when we use the shortcode attribute – “scroll=true”, the accordion, when opened, will scroll to the top of the page.

    Works fine if the top menu is not a fixed (sticky) menu, but with a sticky menu, some of the accordion content gets covered by the menu.

    I looked into the JS file and PHP file and could not figure out how to add some pixel distance so when it scrolls, it won’t go under the sticky menu.

    CSS won’t work, that just moves the entire accordion header and creates a large empty space between the accordion header and content that is above it.

    Any suggestions?

    Thanks

    • This topic was modified 7 years ago by mwarbinek. Reason: fixed grammar
    • This topic was modified 7 years ago by mwarbinek. Reason: fixed punctuation
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    You can provide a pixel offset in the scroll to accommodate a sticky header. Something like scroll="50".

    Thread Starter mwarbinek

    (@mwarbinek)

    Yea, I figured that, but when I had tried before asking, nothing worked. I was trying to work the scroll offset in “accordion.js”, but nothing worked. I went to the core files for the plugin because there was nothing in the documentation that helped.

    Then I went to “accordion.min.js”, I found h.scroll, and changed it to h.scroll="93". This worked, but it affected all accordions since this is a global file.

    Then it dawned on me (banging my head). I remembered reading in the accordion PHP file that the scrolloffset was to be an integer or Boolean (true/false). I finally understood what you referred to.

    In the short-code attribute I changed scroll=true to scroll=93 (the pixel measurement I needed). It worked.

    Question, I noticed that I could use quotes around the attribute “values”, but don’t have to, is that correct?

    Thanks
    (I said all this for those who may have trouble figuring it out).

    Plugin Author philbuchanan

    (@philbuchanan)

    Yes. You can optionally use quotes around values. Unless, of course, the value has a space in it.

    Glad you got it sorted. There are details about each option if you scroll down on the main plugin page.

    Good day,

    I am also have some issues with the [accordion scroll="true"] shortcode.

    It doesn’t seem to make any difference to the scrolling no matter what scrolling value I use.
    I’ve tried using it with single quotations, such as [accordion scroll='100'], double quotations [accordion scroll="100"] and with out quotations [accordion scroll=100]. I’ve tried with different positive integers and I’ve also tried the true and false Boolean as well and nothing seems to change at all.

    Am I missing something?

    Thanks.

    Thread Starter mwarbinek

    (@mwarbinek)

    I am sure Phil has an answer, but what I am getting here is to ask you to deactivate all other plugins, except Jetpack, of course leaving this accordion short-code activate and try your test again.

    Same problem? – switch to a default WordPress theme and test again.

    Same problem? – are you using a browser that has extensions you added? If so try deactivating them and test again, also with the plugins deactivated as above.

    Reason I suggest this is sometimes there is a plugin that conflicts, or a browser extension that causes the issue or it is the theme itself. You need to test those things first to narrow down the source of the cause.

    • This reply was modified 6 years, 10 months ago by mwarbinek.

    Thanks.
    I’ll give that a go.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sticky Menu – Scrolling under the menu’ is closed to new replies.