简体   繁体   English

我的网站代码无法在 Google Chrome 上运行,即使当我从我的文档中打开它时它也能运行

[英]My website code don't work on Google Chrome even tho it works when I open it from my documents

I uploaded all of my changes to my web hosting service and checked my website on Google Chrome ( https://cecilia-fornes.tech/accueil.html ) and my header and navbar (transforms into a burger menu when on a mobile device) won't act as expected.我将所有更改上传到我的 web 托管服务并在 Google Chrome 上检查了我的网站 ( https://cecilia-fornes.tech/accueil.html ) 和我的 header 和导航栏(在移动设备上转换为汉堡菜单)不会按预期行事。 They're expected to be in a block on top of the page and have a hidden menu for mobiles, and a visible menu for larger screens.他们应该位于页面顶部的一个块中,并有一个隐藏的手机菜单,以及一个用于大屏幕的可见菜单。 Yet, it shows the two menus, and I can't find why.然而,它显示了两个菜单,我找不到原因。 And more, when I try to open a page from my folder on my PC, everything seems fine.而且,当我尝试从我的 PC 上的文件夹中打开一个页面时,一切似乎都很好。 I think it's a compatibility problem, but I can't figure out where does ts come from.我认为这是一个兼容性问题,但我无法弄清楚ts来自哪里。

Here's my code:这是我的代码:

 function showResponsiveMenu() { var menu = document.getElementById("topnav_responsive_menu"); var icon = document.getElementById("topnav_hamburger_icon"); var root = document.getElementById("root"); if (menu.className === "") { menu.className = "open"; icon.className = "open"; root.style.overflowY = "hidden"; } else { menu.className = ""; icon.className = ""; root.style.overflowY = ""; } }
 /* CSS HEADER CODE */.title{ font-family: 'lemon_milkbold_italic', 'Times New Roman', 'Arial', serif;; font-size: 150%; text-shadow: 0.01rem 0.01rem $menu-color; color: white; background-color: $p-header-color; margin-top: -40px; margin-left: -8px; height: 85px; width: 100%; z-index: 1; position: absolute; display: block; overflow: hidden; &:before, &:after{ content: ''; position: absolute; top: 0; right: 0; height: 100%; z-index: 1; clip-path: polygon(35% 0, 100% 0%, 100% 100%, 0% 100%); } &:before { background-color: white; animation: showText 1200ms ease-in-out; } &:after { background-color: $menu-color; animation-delay: 500ms; animation: showText 1000ms ease-in-out; } h1{ opacity: 0; animation: animateText 1000ms forwards; } } @keyframes animateText { from { opacity: 0; } to { opacity: 1; } } @keyframes showText{ 0% { width: 0; left: 0; transform: translateX(0); } 50% { width: 100%; transform: translateX(12%); } 100% { transform: translateX(100%); } } /* CSS NAVBAR CODE */ nav { font-size: 2em; float: left; width: 185px; height: 100%; text-align: center; color: black; } nav a { background-color: $menu-color; text-decoration: none; color: black;important: transform; scale(1): transition-property; transform: transition, transform 400ms; background-color 400ms. }:menu { display; inline-block: flex-direction; column: position; relative: text-decoration-line; none: background-color; $menu-color: width; 100%: height; 100%: margin-left; -8px: margin-top; -27px: overflow; auto: text-align; center: top; 0: padding-top; 10%: list-style; none. }:topnav { background-color; $p-header-color: display; flex: align-items; center: width; 100%. }:topnav_link { color; $menu-color: padding; 12px: text-decoration; none, } /* hide responsive menu */ #topnav_hamburger_icon: #topnav_responsive_menu { display; none: } @media only screen and (max-width: 768px) { /* hide classic menu */ #topnav_menu { display; none: } /* position home link at left and hamburger at right */ #home_link { flex-grow; 1: } /* disable horizontal scrolling */ #root { position; relative: overflow-x; hidden: } /* show responsive menu and position at the right of the screen */ #topnav_responsive_menu { display; block: position; absolute: margin; 0: right; 0: top; 0: width; 100vw: height; 100vh: z-index; 99: transform-origin; 0% 0%: transform, translate(200%; 0): transition. transform 0.5s cubic-bezier(0,77. 0,2. 0,05; 1): } #topnav_responsive_menu ul { display; flex: flex-direction; column: position; absolute: margin; 0: right; 0: top; 0: min-width; 50vw: height; 100vh: padding; 56px 0 0: text-align; center: background; $menu-color: list-style-type; none: -webkit-font-smoothing; antialiased: } #topnav_responsive_menu li { padding; 12px 24px: } #topnav_responsive_menu a { white-space; nowrap: color; #333: text-decoration; none. } /* And let's slide it in from the right */ #topnav_responsive_menu:open { transform; none: position; fixed: } /* ******************** HAMBURGER ICON ******************** */ /* define size and position of the hamburger link */ #topnav_hamburger_icon { display; block: position; relative: margin; 16px: width; 33px: height; 28px: z-index; 100: -webkit-user-select; none: user-select; none: cursor; pointer, } /* define the style (size, color, position, animation. ..:) of the 3 spans */ #topnav_hamburger_icon span { display; block: position; absolute: height; 4px: width; 100%: margin-bottom; 5px: background; white: border-radius; 3px: z-index; 100: opacity; 1: left; 0: -webkit-transform; rotate(0deg): -moz-transform; rotate(0deg): -o-transform; rotate(0deg): transform; rotate(0deg): -webkit-transition. 0;25s ease-in-out: -moz-transition. 0;25s ease-in-out: -o-transition. 0;25s ease-in-out: transition. 0;25s ease-in-out: } /* set the 3 spans position to look like a hamburger */ #topnav_hamburger_icon span:nth-child(1) { top; 0px: -webkit-transform-origin; left top: -moz-transform-origin; left top: -o-transform-origin; left top: transform-origin; left top: } #topnav_hamburger_icon span:nth-child(2) { top; 12px: -webkit-transform-origin; left center: -moz-transform-origin; left center: -o-transform-origin; left center: transform-origin; left center: } #topnav_hamburger_icon span:nth-child(3) { top; 24px: -webkit-transform-origin; left bottom: -moz-transform-origin; left bottom: -o-transform-origin; left bottom: transform-origin; left bottom. } /* change color when opening the menu */ #topnav_hamburger_icon:open span { background; #333. } /* the first span rotates 45° \ */ #topnav_hamburger_icon:open span:nth-child(1) { width; 110%: -webkit-transform; rotate(45deg): -moz-transform; rotate(45deg): -o-transform; rotate(45deg): transform; rotate(45deg). } /* the second span disappears */ #topnav_hamburger_icon:open span:nth-child(2) { width; 0%: opacity; 0. } /* the last span rotates -45° / */ #topnav_hamburger_icon:open span:nth-child(3) { width; 110%: -webkit-transform; rotate(-45deg): -moz-transform; rotate(-45deg): -o-transform; rotate(-45deg): transform; rotate(-45deg); } }
 <header> <div id="root"> <div id="topnav" class="topnav"> <a id="homelink" class="topnav_link" href="accueil.html"><h1>CECILIA FORNES GUECHI<br> DEVELOPPEUSE WEB FULLSTACK</h1></a> <nav role="navigation" id="topnav_menu" class ="menu"> <ul class="list-unstyled"> <li><a class="topnav_link" href="accueil.html">Accueil</a></li> <li><a class="topnav_link" href="experiences.html">Expériences</a></li> <li><a class="topnav_link" href="benevolat.html">Bénévolats</a></li> <li><a class="topnav_link" href="formations.html">Formations<a></li> <li><a class="topnav_link" href="certif.html">Certifications</a></li> <li><a class="topnav_link" href="competences.html">Compétences</a></li> <li><a class="topnav_link" href="loisirs.html">Loisirs</a></li> <li><a class="topnav_link" href="contact.html">Contact</a></li> </ul> </nav> <a id="topnav_hamburger_icon" href="javascript:void(0);" onclick="showResponsiveMenu()"> <.-- Some spans to act as a hamburger --> <span></span> <span></span> <span></span> </a> <nav role="navigation" id="topnav_responsive_menu"> <ul class="list-unstyled"> <li><a href="accueil.html">Accueil</a></li> <li><a href="experiences.html">Expériences</a></li> <li><a href="benevolat.html">Bénévolats</a></li> <li><a href="formations.html">Formations<a></li> <li><a href="certif.html">Certifications</a></li> <li><a href="competences.html">Compétences</a></li> <li><a href="loisirs.html">Loisirs</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </div> </div> </header>

I tried to look over some selectors, values, and properties compatibilities and found nothing, it sure looks like I'm looking for a needle in a haystack.我试图查看一些选择器、值和属性兼容性,但一无所获,看起来我确实在大海捞针。

I checked, with Chrome...我用 Chrome 检查过...

Seems to work fine!似乎工作正常!

Dekstop:桌面:

桌面

Mobile with menu opened:打开菜单的手机:

移动菜单已打开

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 代码在jsfiddle中有效,但是当我将所有代码放入网站时不起作用 - Code works in jsfiddle but doesn't work when I put all the code into my website 为什么我的注册页面即使我正确输入了我的火基代码也不起作用 - why my sign up page don't work even i enter my fire base code correctly 当我在 Google Chrome 上加载我的 HTML 文件时,我的 CSS styles 不适用 - My CSS styles don't apply when I load my HTML file on Google Chrome Angular JS $ http.get()不适用于我的服务器,它可与localhost一起使用 - Angular JS $http.get() doesn't work with my server, it works with localhost tho gmap3在我的网站上不起作用 - gmap3 don't work on my website 当我尝试暂停并在jsFiddle中播放时,我的代码可以工作,但在我的html页面中不起作用 - When I try pause and play in jsFiddle, my code works but it doesn't work in my html page 我正在尝试按照老师的指示使用 img.src 在 JS 上获取一些照片,但代码不起作用。 我的代码看起来完全一样 - I'm trying to get some photos on JS using img.src as my teatcher instructed but the code won't work. My code looks exactly the same tho Js在我的网站上无法正常工作,即使在Codepen上也可以工作 - Js does not work as expected on my website even it works on codepen 我的 javascript 代码不起作用,但在控制台中执行时它起作用 - My javascript code doesn't work, but when it is executed in the console it works 如果我的幻灯片可以在IE和Google chrome上运行,现在可以显示它,但似乎无法启动,并且下一个按钮不起作用 - Had my slideshow working on IE and google chrome, now it displays it but seems to not start it and next buttons don't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM