Added buttons next to Elementor horizontal tabs
Hello.
With the help of the Javascript language you can add buttons that lead to other links, next to Elementor tabs, either at the beginning, at the end, or even in between, which makes the tabs look like a menu or a mix of everything horizontal tabs with menus.
First we will define two variables, the 1st is about finding the existing Element via css id and the second is about the html content we want to appear before the 1st tab:
var idelementbefore = document.getElementById('ΕΔΩ ΤΟ ID'); //εάν θέλετε με κλάση αλλάξτε σε document.getElementsByClassName
var neokoumpi1 = 'HTML περιεχόμενο πχ κάποιο div περιεχόμενο';
Right after that we will run the following code:
idelementbefore.insertAdjacentHTML('beforebegin',neokoumpi1);
The aforementioned insertAdjacentHTML function takes two arguments, the 1st argument is where we want the new HTML content to be inserted and the 2nd argument is what the html content is.
For the 1st argument, you can use the following:
- beforebegin -> New content comes first
- afterend -> It goes at the end (after the existing element with the id you gave)
There are other options, if you are interested, reply here and I will help.
See a live example in the screenshot below:
Good luck 😉
This post is also available in: Ελληνικά