Advertisement

Cassiopeia Template Hover Menu

Everything to do with Joomla! 4.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
janbabjan
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Aug 25, 2021 9:00 am

Cassiopeia Template Hover Menu

Post by janbabjan » Mon Aug 30, 2021 1:15 pm

Hi,
I'm trying to set up a Cassiopeia template so that the dropdown menu responds to a mouseover ([ redacted ]). I would also like to expand menu after mouseover the name of the menu (not only down/up arrow).
Thanks
Last edited by toivo on Sat Mar 19, 2022 11:04 am, edited 1 time in total.
Reason: mod note: removed URL to non-Joomla website

Advertisement
wavetheme
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Jan 31, 2020 3:47 pm

Re: Cassiopeia Template Hover Menu

Post by wavetheme » Thu Sep 02, 2021 8:13 am

Hi janbabjan,

Follow some bellow steps to show sub-menu.
- Step 1. Create a file with named custom.css in the css folder.
- Step 2. Add bellow code to the index.php file.

Code: Select all

<head>
	<jdoc:include type="metas" />
	<jdoc:include type="styles" />
	<jdoc:include type="scripts" />
	<link rel="stylesheet" href="<?php echo JURI::root(); ?>/templates/cassiopeia/css/custom.css">
</head>
- Step 3. Add bellow css code to the custom.css file.

Code: Select all

.header .mod-menu > li {
  position: relative;
}

.header .mod-menu li:hover > ul {
  background-color: #fff;
  border: 1px solid #dfe3e7;  
  border-radius: 5px;
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  padding: 16px;
}

.header .mod-menu li:hover > ul li {
  display: block;
}
- Step 4: Reload your website to view all changes.

Best regards,

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1872
Joined: Tue Jun 30, 2020 12:17 pm

Re: Cassiopeia Template Hover Menu

Post by Pavel-ww » Thu Sep 02, 2021 9:58 am

wavetheme wrote: Thu Sep 02, 2021 8:13 am Hi janbabjan,

Follow some bellow steps to show sub-menu.
- Step 1. Create a file with named custom.css in the css folder.
- Step 2. Add bellow code to the index.php file.
Hi.
Why do it? You just need create a file named user.css. It's all. Editing index.php is not required. This file is already included there out of the box.

wavetheme
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Jan 31, 2020 3:47 pm

Re: Cassiopeia Template Hover Menu

Post by wavetheme » Fri Sep 03, 2021 2:13 am

@Pavel-ww,
I tested and it worked fine. Thank you very much.

@janbabjan,
Please create the user.css file after that add all css rules to the user.css file (you don't need to edit any code in index.php file).

mundra1
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Sep 04, 2021 2:50 am

Re: Cassiopeia Template Hover Menu

Post by mundra1 » Sat Sep 04, 2021 6:23 am

Pavel-ww wrote: Thu Sep 02, 2021 9:58 am
wavetheme wrote: Thu Sep 02, 2021 8:13 am Hi janbabjan,

Follow some bellow steps to show sub-menu.
- Step 1. Create a file with named custom.css in the css folder.
- Step 2. Add bellow code to the index.php file.
Hi.
Why do it? You just need create a file named user.css. It's all. Editing index.php is not required. This file is already included there out of the box.
Thanks. Its working fine with desktop but not perfectly on mobile. Please suggest the changes.

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1872
Joined: Tue Jun 30, 2020 12:17 pm

Re: Cassiopeia Template Hover Menu

Post by Pavel-ww » Sat Sep 04, 2021 7:22 am

mundra1 wrote: Sat Sep 04, 2021 6:23 am Thanks. Its working fine with desktop but not perfectly on mobile. Please suggest the changes.
Hi. You quoted the wrong person. I did not offer any solutions for this. My opinion - the click behavior should not be changed to mouseover behavior. Since this contradicts the norms of accessibility

mundra1
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Sep 04, 2021 2:50 am

Re: Cassiopeia Template Hover Menu

Post by mundra1 » Sat Sep 04, 2021 1:36 pm

Pavel-ww wrote: Sat Sep 04, 2021 7:22 am
mundra1 wrote: Sat Sep 04, 2021 6:23 am Thanks. Its working fine with desktop but not perfectly on mobile. Please suggest the changes.
Hi. You quoted the wrong person. I did not offer any solutions for this. My opinion - the click behavior should not be changed to mouseover behavior. Since this contradicts the norms of accessibility
Thanks a lot

Advertisement

Locked

Return to “Templates for Joomla! 4.x”