Icon or image to toggle visibility

Hi,
I’m creating a custom hamburger menu and I was wondering if there’s any way to use an svg icon or an image as a link or to use it to toggle visibility.

Thanks!

Hi @giouann, you can do that using the custom attributes:
data-toggle = “collapse”
data-target = “#yourid

I always wonder… where do I find more about those data-stuff that I can use within Blocs and what I can use it for?

Most of it you can find in the bootstrap Documentation.

2 Likes

Thanks Pete, I was searching the Blocs Manual, but … no details about data attributes there. Will check the Bootstrap Documentation - when I have time :wink:

Yeah I don’t think the Blocs manual will say anything about them.

So many options it’s often easy to learn as you go. Eg. Check the docs when you want to figure something out.

Even looking at the Bootstrap documentation, unless you have a candid idea I still can’t work anything out except by trial and error.

It looks like in BS5 there’s some class changes. I.e. “data-toggle” in BS4 becomes “data-bs-toggle” in BS5.