Foundation 5 off-canvas full height of device
Try if this works, first enclose the <div class="off-canvas-wrap">
in another div
<div class="page">
<div class="off-canvas-wrap">
<div class="inner-wrap">
[..]
</div>
</div>
</div>
And then set the following css,
body,html{
height:100%;
width:100%;
}
.off-canvas-wrap,.inner-wrap{
height:100%;
}
If you want to block scrolling, say for a chat client, set .page
height to 100%. And that would be
body,html{
height:100%;
width:100%;
}
.off-canvas-wrap,.inner-wrap{
height:100%;
}
.page{
height:100%;
}
Zurb Foundation 6 Increasing the size of offcanvas makes it visible while loading time
You just need to add the CSS for transitioning in all states. I think this is also what's causing the jump in view on page load too. I believe that adding this to your styles will work:
#off-canvas-right {
&.off-canvas {
width: 600px;
transform: translateX(600px);
&.is-open {
transform: translate(0, 0);
}
}
}
Here's a link to a working CodePen
How to make Foundation 5 off-canvas navigation menu sticky?
Make the height of the content 95vh and the overflow-y=scroll. Whenever the content on the right is scrolled, the off-canvas menu is unaffected and remains at the top.
CSS:
.mycontent {
height:95vh;
overflow-y:scroll;
/* fix scrolling on webkit touch devices (iPhone etc) */
-webkit-overflow-scrolling: touch;
}
HTML:
<div class="row mycontent" >
<div class="large-12 columns">
<h1>Welcome to Foundation</h1>
</div>
</div>
Zurb Foundation 5 offcanvas not working
Unfortunately, Ribena's answer is not working anymore, at version 5.2.3, though it was at version 5.0.3.
For it to work now, the trigger javascript needs to be put:
- or at the end of the
<body>
tag as it said in the docs, like Daniel said - or inside the
<head>
this way (using JQuery):
<script>
$(window).bind("load", function () {
$(document).foundation();
});
</script>
Foundation - Off Canvas Scroll Issue
This is very popular Foundation issue:
http://foundation.zurb.com/forum/posts/965-fixed-menu-using-offcanvas
http://foundation.zurb.com/forum/posts/547-off-canvas-with-fixed-top-bar
https://github.com/zurb/foundation/issues/3863
https://github.com/zurb/foundation/issues/3710
Despite of it seems that official solution doesn's exist yet I have found this one (reference) which looks like a nice fix of your problem.
HTML
<div class="off-canvas-wrap">
<div class="inner-wrap">
<div class="header">
<nav class="tab-bar" data-offcanvas>
<section class="left-small">
<a class="left-off-canvas-toggle menu-icon">
<span></span>
</a>
</section>
<section class="right tab-bar-section">
<h1>Foundation 5 test</h1>
</section>
</nav>
</div>
<aside class="left-off-canvas-menu">
<ul class="off-canvas-list">
<li>
<label>Foundation</label>
</li>
[...]
<li><a href="#">The Psychohistorians</a>
[...]
</li>
</ul>
</aside>
<article class="small-12 columns">
<p>Content</p>
<p>Content</p>
<div data-magellan-expedition="fixed">
<dl class="sub-nav panel">
<dd data-magellan-arrival="build">
<a href="#build">Build with HTML</a>
</dd>
<dd data-magellan-arrival="js">
<a href="#js">Arrival 2</a>
</dd>
</dl>
</div>
[...]
<p>Content</p>
[...]
</article>
<a class="exit-off-canvas"></a>
<footer class="small-12 columns">
<div>...</div>
</footer>
</div>
</div>
CSS
article {
overflow-y: auto;
}
article,
body,
html,
.off-canvas-wrap,
.off-canvas-wrap .inner-wrap,
.row {
height: 100%;
width: 100%;
}
.header {
position: absolute;
top: 0;
width: 100%;
z-index: 99;
}
Related Topics
How to Start a New Line with a Particular Item with Flexbox
How to Achieve Curved Top Pointer
How to Make Nice Looking Matrix of Buttons with Bootstrap 3
How to Margin the Body of the Page (Html)
Creating a Sidebar Within a Flexbox with CSS
Is It a Bug? Margins of P Element Go Outside the Containig Div
CSS Two Columns of Lists - Responsive Merge into One Column
Why Does Negative Z-Index and Non-Static Position Disable My Checkbox in Most Browsers
Change the Z Index of Flash Content
Why Is Using the Style-Attribute in HTML Bad
Flexbox Layout Does Not Work in Internet Explorer 10
Changing the Text Selection Color Using CSS
Do HTML5 Script Tag Need Type="Javascript"
How to Display Source Code with Indent in a Web Page? HTML? CSS