From d33fc25c3fddb6445c159fe3a267a4ec94684f13 Mon Sep 17 00:00:00 2001 From: rulingcom Date: Thu, 16 Sep 2021 03:43:37 +0000 Subject: [PATCH] fix error --- assets/javascripts/app.js | 8 ++++---- assets/stylesheets/template/widget/sitemenu.scss | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 3cbbb7d..8ff468f 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -427,7 +427,7 @@ orbit.setColumn('.left-column', '.right-column'); // 自適應網頁使用,當網頁載入時,如果視窗寬度小於769,就執行orbit.nav.setDropdown函數 - if ($(window).width() < 769) { + if ($(window).outerWidth() < 769) { // orbit.nav.setDropdown(); orbit.MobileMenu(); $('.mobile-menu').append($('.modules-menu')); @@ -441,7 +441,7 @@ // 自適應網頁使用,當使用者改變瀏覽器寬度時呼叫orbit.nav.setDropdown函數 $(window).resize(function() { - if ($(window).width() < 769) { + if ($(window).outerWidth() < 769) { if (resizeTimer) clearTimeout(resizeTimer); $('.outdropdowns').before($('.header-nav')); resizeTimer = setTimeout(function() { @@ -715,7 +715,7 @@ function transdate(){ $(document).ready(function() { //RWD 自動縮放headerbannner function headerH() { - if ($(window).width() < 769) { + if ($(window).outerWidth() < 769) { const navH = $('.layout-header .navbar-header').outerHeight(); } @@ -839,7 +839,7 @@ function transdate(){ $(document).resize(function() { $('.modules-menu-level-1').css('left','-'+$('.outdropdowns .dropdowns').offset().left+'px'); - if ($(window).width() < 769){ + if ($(window).outerWidth() < 769){ $('.modules-menu-level-1').css('left','') } diff --git a/assets/stylesheets/template/widget/sitemenu.scss b/assets/stylesheets/template/widget/sitemenu.scss index 9b01bb9..3aa8350 100644 --- a/assets/stylesheets/template/widget/sitemenu.scss +++ b/assets/stylesheets/template/widget/sitemenu.scss @@ -2,6 +2,7 @@ @import "../initial"; + .sitemenu-horizontal { @media(max-width:769px){ padding-right: 0.9375em; @@ -76,6 +77,17 @@ border-radius: 0.25em; box-shadow: 0px 0px 0px 1px #d7d7d7; margin: 0 -1px!important; + @media (min-width: 768){ + &:hover > ul{ + display: block; + position: absolute; + left: 100%; + top: 0; + } + li{ + background: white; + } + } } .sitemenu-item.level-1 {