抱歉没有问题。我不擅长css但是如何让画布上的基础框架看起来平坦?它似乎在边缘有一个渐变,使它看起来像3D,我不喜欢它。谢谢你的回答!
我编辑了我的问题,添加了我的代码,以便您可以将其可视化。
我实际上在这里遇到了两个问题,首先,我想让我的画布变得平坦。我在画布上搜索了所有的元素并将它放在这里。您认为我应该改变什么?
第二个是当我在mozilla关闭画布时打开这些代码,每次我点击一个链接到id的菜单时都会自动关闭..但不是在chrome中。
这是我第一次尝试基础。再次感谢您的回答!
$(document).foundation();
$(".sub-menu").hide();
$(".main-menu").on("click", function(){
if($(this).hasClass('active')) {
$(this).next('.sub-menu').slideToggle();
} else {
$(".main-menu").removeClass('active');
$(this).addClass('active');
$(".sub-menu").slideUp();
$(this).next('.sub-menu').slideDown();
}
});

.sub-menu li
{
list-style-type: none;
}
.off-canvas-wrap {
-webkit-backface-visibility: hidden;
position: relative;
width: 100%;
overflow: hidden; }
.off-canvas-wrap.move-right, .off-canvas-wrap.move-left {
min-height: 100%;
-webkit-overflow-scrolling: touch; }
.left-off-canvas-menu {
-webkit-backface-visibility: hidden;
width: 15.625rem;
top: 0;
bottom: 0;
position: absolute;
overflow-x: hidden;
overflow-y: auto;
background: #333333;
z-index: 1001;
box-sizing: content-box;
transition: transform 500ms ease 0s;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
-ms-transform: translate(-100%, 0);
-webkit-transform: translate3d(-100%, 0, 0);
-moz-transform: translate3d(-100%, 0, 0);
-ms-transform: translate3d(-100%, 0, 0);
-o-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
left: 0; }
.left-off-canvas-menu * {
-webkit-backface-visibility: hidden; }
.right-off-canvas-menu {
-webkit-backface-visibility: hidden;
width: 15.625rem;
top: 0;
bottom: 0;
position: absolute;
overflow-x: hidden;
overflow-y: auto;
background: #333333;
z-index: 1001;
box-sizing: content-box;
transition: transform 500ms ease 0s;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
-ms-transform: translate(100%, 0);
-webkit-transform: translate3d(100%, 0, 0);
-moz-transform: translate3d(100%, 0, 0);
-ms-transform: translate3d(100%, 0, 0);
-o-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
right: 0; }
.right-off-canvas-menu * {
-webkit-backface-visibility: hidden; }
ul.off-canvas-list {
list-style-type: none;
padding: 0;
margin: 0; }
ul.off-canvas-list li label {
display: block;
padding: 0.3rem 0.9375rem;
color: #999999;
text-transform: uppercase;
font-size: 0.75rem;
font-weight: bold;
background: #444444;
border-top: 1px solid #5e5e5e;
border-bottom: none;
margin: 0; }
ul.off-canvas-list li a {
display: block;
padding: 0.66667rem;
color: rgba(255, 255, 255, 0.7);
border-bottom: 1px solid #262626;
transition: background 300ms ease; }
ul.off-canvas-list li a:hover {
background: #242424; }
.move-right > .inner-wrap {
-ms-transform: translate(15.625rem, 0);
-webkit-transform: translate3d(15.625rem, 0, 0);
-moz-transform: translate3d(15.625rem, 0, 0);
-ms-transform: translate3d(15.625rem, 0, 0);
-o-transform: translate3d(15.625rem, 0, 0);
transform: translate3d(15.625rem, 0, 0); }
.move-right .exit-off-canvas {
-webkit-backface-visibility: hidden;
transition: background 300ms ease;
cursor: pointer;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.2);
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1002;
-webkit-tap-highlight-color: transparent; }
@media only screen and (min-width: 40.063em) {
.move-right .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.move-left > .inner-wrap {
-ms-transform: translate(-15.625rem, 0);
-webkit-transform: translate3d(-15.625rem, 0, 0);
-moz-transform: translate3d(-15.625rem, 0, 0);
-ms-transform: translate3d(-15.625rem, 0, 0);
-o-transform: translate3d(-15.625rem, 0, 0);
transform: translate3d(-15.625rem, 0, 0); }
.move-left .exit-off-canvas {
-webkit-backface-visibility: hidden;
transition: background 300ms ease;
cursor: pointer;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.2);
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1002;
-webkit-tap-highlight-color: transparent; }
@media only screen and (min-width: 40.063em) {
.move-left .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap .left-off-canvas-menu, .offcanvas-overlap .right-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
-moz-transform: none;
-o-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap .exit-off-canvas {
-webkit-backface-visibility: hidden;
transition: background 300ms ease;
cursor: pointer;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.2);
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1002;
-webkit-tap-highlight-color: transparent; }
@media only screen and (min-width: 40.063em) {
.offcanvas-overlap .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap-left .right-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
-moz-transform: none;
-o-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap-left .exit-off-canvas {
-webkit-backface-visibility: hidden;
transition: background 300ms ease;
cursor: pointer;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.2);
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1002;
-webkit-tap-highlight-color: transparent; }
@media only screen and (min-width: 40.063em) {
.offcanvas-overlap-left .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.offcanvas-overlap-right .left-off-canvas-menu {
-ms-transform: none;
-webkit-transform: none;
-moz-transform: none;
-o-transform: none;
transform: none;
z-index: 1003; }
.offcanvas-overlap-right .exit-off-canvas {
-webkit-backface-visibility: hidden;
transition: background 300ms ease;
cursor: pointer;
box-shadow: -4px 0 4px rgba(0, 0, 0, 0.5), 4px 0 4px rgba(0, 0, 0, 0.5);
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.2);
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1002;
-webkit-tap-highlight-color: transparent; }
@media only screen and (min-width: 40.063em) {
.offcanvas-overlap-right .exit-off-canvas:hover {
background: rgba(255, 255, 255, 0.05); } }
.no-csstransforms .left-off-canvas-menu {
left: -15.625rem; }
.no-csstransforms .right-off-canvas-menu {
right: -15.625rem; }
.no-csstransforms .move-left > .inner-wrap {
right: 15.625rem; }
.no-csstransforms .move-right > .inner-wrap {
left: 15.625rem; }

<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation | Welcome</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.0/css/foundation.min.css" />
</head>
<body><div class="off-canvas-wrap" data-offcanvas> <div class="inner-wrap"> <nav class="tab-bar"> <section class="left-small"> <a class="left-off-canvas-toggle menu-icon" href="#"><span></span></a> </section> <section class="middle tab-bar-section"> <h1 class="title">Foundation</h1> </section></a> </section> </nav>
<aside class="left-off-canvas-menu">
<ul class="off-canvas-list">
<li><label>Some Action</label></li>
<li class="main-menu"><a href="#">Main Menu</a></li>
<ul class="sub-menu">
<li><a href="#">Sub Menu</a></li>
<li><a href="#">Sub Menu</a></li>
<li><a href="#gohere">ID go here</a></li>
</ul>
<li class="main-menu"><a href="#">Main Menu</a></li>
<ul class="sub-menu">
<li><a href="#">Sub Menu</a></li>
<li><a href="#">Sub Menu</a></li>
<li><a href="#gohereagain">ID go here again</a></li>
</ul>
</ul>
</aside>
<section class="main-section">
<!-- content goes here -->
<div id="gohere">
<pre>
Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</pre>
</div>
<div id="gohereagain"> <pre>
Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</pre></div>
</section> <a class="exit-off-canvas"></a> </div> </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.0/js/vendor/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.0/js/foundation.min.js"></script>
</body>
</html>
&#13;
答案 0 :(得分:0)
假设doc中显示的unstyled
非画布,这样的东西应该有效。
更新了CSS
.move-right .exit-off-canvas {
box-shadow: none;
}
.move-left .exit-off-canvas {
box-shadow: none;
}
注意 确保加载基础css后加载 。
<强> FIDDLE 强>
至于子菜单的其他问题,您的示例中包含以下代码
<a href="#gohere">ID go here</a>
这告诉浏览器执行以下操作:
链接到页面中具有指定ID的元素(例如 HREF =&#34;#顶部&#34)
但是FireFox
有一个known bug与在哈希锚中使用ID有关。有很多技术可以在网上解决这个问题,但我没有看到任何在这个网站上发布的合适解决方案。