Home Forums Particles Support Button-link in JL Feature Box only opens in new tab or window. Not same window.

Viewing 9 posts - 1 through 9 (of 9 total)

  • Torbjörn
    Subscriber

    I’m using JL Feature Box (latest release) and I’m glad for it. Specially with the nice design-possibillities etc.

    However, this is strange…..
    Linking the button to a menu-item on same website is no problem. BUT when linking to an id or anchor on that menu-item, it doesn’t work. When clicking the button it just scroll up to top of page.
    If i right-click the same button and choose “Open in new tab” or “Open in new window”, it works fine. Strange !?!?

    I think it is a js conflict somewhere, but can’t find it. Here is a link to the page with particle jlfeaturebox.

    If anyone have a solution – I would REALLY like to know 🙂

    Regards
    Torbjörn


    Tony
    Moderator

    BUT when linking to an id or anchor on that menu-item, it doesn’t work. When clicking the button it just scroll up to top of page.

    By default, smooth scroll feature added automatically to page-internal link that contains a URL fragment.

    Do you know about ONE-PAGE scrolling? Its the same method :), see more detail

    I’m not sure about your button settings, if you want to navigate from the button to special sections, simply defined the same section id for button anchor link.

    Example button link: #my-id
    And the section to scroll to: <h1 id="my-id">End here!</h1>


    Tony
    Moderator

    Or if you want, I can help to remove the scroll feature for the particle 🙂


    Torbjörn
    Subscriber

    Thanks for your reply, Tony.
    I know about href to id on same page or another menu-item. This page has responsive tables with a lot of href’s to different sections on many internal/external webpages.

    Yeah, I figured out that it was someting with the smooth scroll feature – but in the file jlfeaturebox.html.twig it is so many “scroll”, I didn’t know what “scroll” to <!-- comment out -->.

    No matter if I use button, title or item type link, the url without id /another/menu/item works fine. But the url with an id /another/menu/item#my-id just scrolls to page-top. Even if I use particle-target New window.

    So Tony, if you could tell me what lines in the twig-file I should comment out, I’ll test it and see if it works 🙂

    Regards
    Torbjörn


    Torbjörn
    Subscriber

    Tony wrote:

    Or if you want, I can help to remove the scroll feature for the particle

    Yes, please !!
    Tell me how to remove the scroll feature from this particle.

    Look forward to your fast reply 🙂


    Tony
    Moderator

    Hi there,
    Please open the jlfeaturebox.html.twig then change

    {% set linkscroll %}
    {% if item.buttonlink|e matches '/#/' %} jl-scroll{% endif %}
    {% endset %}

    to

    {% set linkscroll %}
    {% if particle.class != 'no-scroll' %}
    {% if item.buttonlink|e matches '/#/' %} jl-scroll{% endif %}
    {% endif %}
    {% endset %}

    after, open feature box particle, add no-scroll class to the particle to remove scroll feature 🙂
    No Scroll
    Let me know if it works for you.


    Torbjörn
    Subscriber

    Thanks for the fast reply, Tony
    And thanks for the piece of code.

    I’ll test the code first thing tomorrow morning, and let you know how it work.

    Regards
    Torbjörn


    Torbjörn
    Subscriber

    WONDERFUL !!

    It works perfect, Tony.
    Again thank you very much for your help.


    Tony
    Moderator

    You’re welcome 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

80+ templates updated for Joomla 5.1.4 and JoomLead particles 2.3.0 Download
Flash Sale. Get Up to 25% Off - Coupon: FLASH25 Shop Now