Home › Forums › Particles Support › Button-link in JL Feature Box only opens in new tab or window. Not same window.
-
TorbjörnSubscriberI’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
TonyModeratorBUT 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>
TonyModerator
TorbjörnSubscriberThanks 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örnSubscriber
TonyModeratorHi 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 🙂
Let me know if it works for you.
TorbjörnSubscriber
TorbjörnSubscriber
TonyModerator
You must be logged in to reply to this topic.