You can provide a pixel offset in the scroll to accommodate a sticky header. Something like scroll="50".
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).
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.
-
This reply was modified 8 years, 6 months ago by
philbuchanan.
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.
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 8 years, 4 months ago by
mwarbinek.
Thanks.
I’ll give that a go.