This commit is contained in:
ken 2025-07-29 20:57:29 +08:00
parent 718f665d89
commit bcd65bd164
4 changed files with 45 additions and 11 deletions

View File

@ -1137,9 +1137,9 @@ $(document).ready(function () {
$('.searchclass').appendTo('.header-nav'); $('.searchclass').appendTo('.header-nav');
} }
} else { } else {
if (!$('.navbar-header .searchclass').length) {
$('.navbar-brand').after($('.searchclass')); $('.navbar-brand').after($('.searchclass'));
}
} }
} }
@ -1569,6 +1569,31 @@ $(document).ready(function () {
$(this).find('span').text(selectedText + '(已選取)'); $(this).find('span').text(selectedText + '(已選取)');
}); });
}); });
//選單li加上fa-chevron-down
$(document).ready(function () {
function addDropdownIcons() {
if ($(window).width() > 769) {
$('#main-nav.modules-menu-level-0 > li').each(function () {
if ($(this).children('ul').length > 0) {
const $toggle = $(this).children('a.dropdown-toggle');
if ($toggle.find('i.fa-chevron-down').length === 0) {
$toggle.append(' <i class="kenmenu-drop fa-solid fa-chevron-down"></i>');
}
}
});
}else {
// 螢幕寬度小於等於 768 時,移除所有 chevron-down icon
$('#main-nav.modules-menu-level-0 .kenmenu-drop').remove();
}
}
addDropdownIcons();
$(window).resize(function () {
addDropdownIcons();
});
});
// //選單樣式2 // //選單樣式2
// $(document).ready(function() { // $(document).ready(function() {
// "use strict"; // "use strict";

View File

@ -7,7 +7,6 @@
} }
@media(max-width: 767px) { @media(max-width: 767px) {
.modules-menu .modules-menu-level-0>li { margin: 0; } .modules-menu .modules-menu-level-0>li { margin: 0; }
.modules-menu .modules-menu-level-0>li:hover { background: transparent; }
} }
@media(max-width: $screen-xs) { @media(max-width: $screen-xs) {

View File

@ -8,6 +8,9 @@
background-color: #fff; background-color: #fff;
position: relative; position: relative;
padding:0; padding:0;
@media(max-width:768px){
padding: 0.5em 0;
}
} }
.header-nav { .header-nav {
display: flex !important; display: flex !important;

View File

@ -165,11 +165,14 @@
.modules-menu{ #layout-navigation{
background-color: $theme-color-second; background-color: $theme-color-second;
// border-top: 5px solid #9f9f9fcc; // border-top: 5px solid #9f9f9fcc;
} }
.kenmenu-drop{
padding-left: 0.5em;
font-size: small;
}
#layout-navigation{ #layout-navigation{
@media(min-width: 769px){ @media(min-width: 769px){
@ -249,7 +252,7 @@
border-radius: 0.13em; border-radius: 0.13em;
top: 2em; top: 2em;
@media(max-width: 769px){ @media(max-width: 769px){
top: 1em; top: 0.5em;
font-size: 1em; font-size: 1em;
} }
} }
@ -266,14 +269,15 @@
list-style: none; list-style: none;
position:relative; position:relative;
margin: 0; margin: 0;
padding: 0.5em; padding:0;
border-bottom: 0.0625em solid lighten($theme-gray, 5%); // border-bottom: 0.0625em solid lighten($theme-gray, 5%);
& > a { & > a {
display: block; display: block;
padding: 1em; padding: 1em;
font-family: $main-font; font-family: $main-font;
font-size: 1.1em; font-size: 1.1em;
color: #fff;
&:after{ &:after{
content:''; content:'';
position:absolute; position:absolute;
@ -291,7 +295,7 @@
bottom:0; bottom:0;
} }
&.active { &.active {
color: $theme-color-second; color: #fff;
background: none; background: none;
&:after{ &:after{
width:100%; width:100%;
@ -301,9 +305,9 @@
} }
&:hover { &:hover {
background: rgba(darken($theme-color-second, 10%), 1);
& > a { & > a {
// color: $theme-color-second; // color: $theme-color-second;
background: rgba(darken($theme-color-second, 10%), 1);
box-shadow:none; box-shadow:none;
&:after{ &:after{
width:100%; width:100%;
@ -531,10 +535,13 @@
width: 80%; width: 80%;
position: absolute; position: absolute;
right: 0; right: 0;
background: #ffffff; background:$theme-color-second;
height: 100%; height: 100%;
top: 0; top: 0;
padding-top: 40px; padding-top: 40px;
color: #fff;
padding-left: 0;
padding-right: 0;
} }
.modules-menu .modules-menu-level-0 > li > a, .modules-menu .modules-menu-level-0 ,.modules-menu .modules-menu-level-0 > li { .modules-menu .modules-menu-level-0 > li > a, .modules-menu .modules-menu-level-0 ,.modules-menu .modules-menu-level-0 > li {
font-weight:bold; font-weight:bold;