In order for the off-canvas part to be displayed by default on wider screens, you need to add the "expand" class for your area without a canvas, for example reveal-for-medium . Try the following:
<div class="off-canvas-wrapper"> <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper> <div class="title-bar" data-responsive-toggle="widemenu" data-hide-for="medium"> <div class="title-bar-left"> <button class="menu-icon" type="button" data-open="offCanvasLeft"></button> <span class="title-bar-title">Open sidebar</span> </div> </div> <div class="off-canvas position-left reveal-for-medium" id="offCanvasLeft" data-off-canvas > <h3>Side area</h3> <p>Lorem ipsum dolor sit amet</p> </div> <div id="widemenu" class="top-bar"> <div class="top-bar-left"> Top area </div> </div> <div class="off-canvas-content" data-off-canvas-content> <div class="row column"> <h3>Main content</h3> <p>Lorem ipsum dolor sit amet</p> <img src="http://placehold.it/2000x3000" alt="" /> </div> </div> </div> </div>
You can put any content in the area outside the canvas. It should not be limited to a list, menu or navigation. In the above example, I just put the title and paragraph of the content.
To adjust the width of the area outside the canvas, you need to override the default CSS CSS. In this case, the .position-left.reveal-for-medium ~ .off-canvas-content selector. So in your CSS that you use to override Foundation styles (so you need to load it after Foundation CSS), you would do something like this:
.position-left.reveal-for-medium ~ .off-canvas-content { margin-left: 50%; }
You can adjust the width of the canvas element with a small screen by adjusting the is-open-left class, for example:
.is-open-left { transform: translateX(90%); }
Move these percentages around to exactly match the effect you're looking for. In both cases, these are just standard CSS overrides. I recommend that you use the Chrome or Firebug inspectors (depending on what you use) to check the elements in the layout and play around looking for specific CSS selectors that you need to override.
For more information about using inspectors, see the following sections: https://developers.google.com/web/tools/chrome-devtools/ and also: http://getfirebug.com/faq/#Is_there_some_basic_description_of_how_Firebug_works
source share