• Resolved gusgorman

    (@gusgorman)


    Hi There,
    First off all, I’d just like to thank you for such an incredible plug-in!

    I’ve been able to apply the scroll to every link on my page, but I have an exception that is being troublesome. It’s a button that just won’t cooperate. I want to click the button and have it scroll to “#contact”. The problem is that the button was created in a plug-in called Buttons X, and everything is built inside a wysiwyg framework, so there isn’t an opportunity to add code like “rel=’m_PageScroll2id'”. All it provides is a field for you to enter the link. Adding “#contact” simply makes it jump to the contact section of my site, with no sexy scroll.

    So since adding the scroll code from within the Buttons X builder seems out of the question, can I add it to the button from the outside? Buttons X gives me a shortcode to place the button (which looks like: [btnsx id=”8927″]), so is there any scroll code I can place within those brackets, or surrounding them? Basically, is there a way to apply the scroll to an existing shortcode?

    I don’t mind having to go to the actual HTML or CSS pages of my site, but if that’s the case, I might need a little guidance as to what to place and where.

    Thanks so much!

    https://ww.wp.xz.cn/plugins/page-scroll-to-id/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author malihu

    (@malihu)

    Hello,

    You can enable the plugin on any link you like without adding rel or class attributes. All you need is to add the link’s selector in ‘Selector(s)’ field in plugin settings.

    I checked “Buttons X” plugin and it seems that the buttons get the class btnsx-btn. So you have a selector like this:

    .btnsx-btn[id]

    The above applies to elements with the class btnsx-btn and an id attribute.

    You could also be more specific like:

    .btnsx-btn[id='8927']

    which applies to the element with the class btnsx-btn and id attribute 8927.

    You can insert the above in ‘Selector(s)’ field along with the default value by separating them with comma, e.g.:

    a[rel='m_PageScroll2id'], .btnsx-btn[id]

    or:

    a[rel='m_PageScroll2id'], .btnsx-btn[id='8927'], .btnsx-btn[id='8928']

    etc.

    For extended info on the ‘Selector(s)’ option see plugin’s contextual ‘Help’ – ‘Plugin settings’.

    Hope this helps

    Thread Starter gusgorman

    (@gusgorman)

    Hey Malihu,
    Wonderful, thank you so much! The selector field looked pretty menacing, so it kind of became invisible to me because I just assumed I shouldn’t touch it.

    Oddly, being specific with the attribute (eg. “.btnsx-btn[id=’8927′]”) didn’t work, but the more general “.btnsx-btn[id]” DID work.

    So once again, I just want to thank you for your incredible plug-in, and wickedly-fast support. You’re awesome.

    Thanks!

    Plugin Author malihu

    (@malihu)

    You’re welcome 🙂

    The specific code example should work if your button has the id 8927. Assuming the ids are unique (they should be), you could do it more simple like #8927.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add Scroll Link to Existing Shortcode’ is closed to new replies.