• Resolved Kristián Filo

    (@kristianfilo)


    Hi, somehow I can get the plugin to work and I am stuck. These are the link elements:

    <a href="#cart-gifts" class="ps2id">My link</a>

    And this is the target element:

    <div id="cart-gifts">
    ...
    </div>

    Clicking the link jumps to the target and ignores the plugin’s offset (the same behavior as if the plugin wasn’t installed at all).

    However, reloading the page with an anchor in URL (e.g. mysite.com/#cart-gifts) works just fine, it scrolls once the page is loaded with the proper offset.

    Apart from the offset, all settings are default. I’ve also tried enabling "Prevent other scripts from handling plugin’s links (if possible)" with the following selector: a.ps2id, but no luck.

    There shouldn’t be any conflicting plugins, the code is generated (both links and target) on Cart page using WooCommerce actions, so there is no page builder included or anything like that.

    I am attaching the URL as well, but you need to add some products to the cart and then navigate to the Cart page, you should see a progress bar below header, then if you click the “Gift” icons, it should scroll you down to the #cart-gifts section.

    What could be the issue? Thank you.

    The page I need help with: [log in to see the link]

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

    (@malihu)

    Hi,

    Can you tell me which link to test in https://zmiesanytovar.sk/?
    I’m asking cause I couldn’t find any links that scroll the page.

    Thread Starter Kristián Filo

    (@kristianfilo)

    Hello @malihu ,

    you need to add some product to Cart, then navigate to the Cart page: https://zmiesanytovar.sk/kosik/

    On that page you should see a progress bar with “Gift” icons, which should scroll you down the page to cart-gifts anchor ID:

    https://i.ibb.co/J5G37g1/cart.jpg

    Plugin Author malihu

    (@malihu)

    OK, the issue you’re having is because the gift icon links have the data-toggle attribute set. The plugin by default does not handle links with data-toggle attributes because such links usually toggle some kind of data and do not not scroll the page. That’s why smooth scrolling is not working.

    The solution is to remove the data-toggle selector from plugins excluded selectors. So, go to “Page scroll to id” settings and remove the following part from “selectors are excluded” option field:

    a[data-toggle]:not([data-toggle='tooltip']),

    Remove exactly the value above (including the space at the end of it) and nothing else from the option field.

    Save changes, test and let me know.

    Thread Starter Kristián Filo

    (@kristianfilo)

    @malihu Thank you, works like a charm!

    Apparently either WP or one of the plugins generates these data attributes for “tooltip” class, I didn’t notice that.

    Resolved.

    Plugin Author malihu

    (@malihu)

    You’re welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Smooth scrolling doesn’t work on link click’ is closed to new replies.