You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come across some situations where I don't know how many sets of tab will be on a page, and so have to loop over all instances of [data-tabs] to initialize a Tabby for it. I've achieved this with..
const ELEMENTS = document.querySelectorAll("[data-tabs]");
if (ELEMENTS.length > 0) {
ELEMENTS.forEach((element) => {
new Tabby(`#${element.getAttribute("id")}`);
});
}
but that seems somewhat fragile and also confusing to read. Being able to directly pass element in this case would really simplify things.
The text was updated successfully, but these errors were encountered:
I've come across some situations where I don't know how many sets of tab will be on a page, and so have to loop over all instances of
[data-tabs]
to initialize a Tabby for it. I've achieved this with..but that seems somewhat fragile and also confusing to read. Being able to directly pass
element
in this case would really simplify things.The text was updated successfully, but these errors were encountered: