Toggle class or visibility on hover?

any chance there’s a way to toggle sth. on hover? f.e. if you’ve go a list and hover one of the items, a preview appears. Or a dropdown menu opens not only on klick but already on hover…

You can with a bit of javascript. What specifically do you want to do.

it‘s connected with this idea:

Idea/solution for more styling options for the mobile navigation

I would like to open the subnavs on hover. And of course my mind is already searching for new ideas, how to use it XD

Complex way to make a menu :thinking:

You wanna say, the way I chose is complex, or is it complex to make the hover-thing happen for a menu?

Well you could use a regular menu for that. All the dropdown stuff is then already implemented.

Yes of course. If the only point of view is functionality, you’re absolutely right. But regarding styling and adding stuff like forms etc. the regular menu is very limited. And as we know in some cases even the active link isn’t working, nobody knows why (I’m talking about the fullscreen mobile nav).
Regarding the raw project I’ve presented, of course there’s no big difference to the regular menu… but imagine the possibilities it gives you.

Hi @benfluri, if I recall correctly @Eldar made a few tutorials in regards to adding forms etc. Your best bet is going to be the new .offcanvas in Bootstrap 5. Possibilities are endless!

Thanks @Jerry I read about it. Very exciting!
But it‘s BS 5 isn‘t it?

Yup, it is.

so it might take a while, until we could really use it for real project, as I understand Norm’s statement to the betas…

Not really as @Norm expects BS5 Will be out of Beta before Blocs 4.2. My personal feeling says he could be right.

Hi Jerry,

Hope you are well and enjoying the sunshine, the perfect beaches, the fresh sea air, the cocktails at sunset…while I look outside in the UK wondering if I go on a bike ride today, if it’s going to rain again!!!

Just saw your post which I quoted above - the offcanvas in bootstrap 5, I am not the best when it comes to things like understanding this and other differences in BS5 which is soon to be with us all.

What will offcanvas do/mean and do you have any examples of basic ideas with this and anything else BS5 can do for us, I remember seeing some info for offcanvas for BS4, but this will be much better is BS5 i guess. I am looking at doing something for a side menu at some point / hidden.

Thanks Jerry.

Hi @AdieJAM. It’s all here: https://blog.getbootstrap.com/2021/03/23/bootstrap-5-beta-3/

1 Like