CSS fixed nav with jquery -
i've css, cause of following problem; nav wont stay fixed. please help
the problem (since deleted this, worked)
[canvas] { z-index: 1; } [canvas=container] { width: 100%; height: 100%; overflow-y: auto; position: relative; background-color: white; /* basic background color, overwrite in own css. */ -webkit-overflow-scrolling: touch; /* enables momentum scrolling on ios devices, may removed setting 'auto' in own css. */ } [canvas=container]:before, [canvas=container]:after { clear: both; content: ''; display: table; } /** * off-canavs */ [off-canvas] { display: none; position: fixed; overflow: hidden; overflow-y: auto; background-color: black; color: white; /* basic colors, overwrite in own css. */ -webkit-overflow-scrolling: touch; /* enables momentum scrolling on ios devices, may removed setting 'auto' in own css. */ } [off-canvas*=top] { width: 100%; height: 255px; top: 0; } [off-canvas*=right] { width: 255px; height: 100%; top: 0; right: 0; } [off-canvas*=bottom] { width: 100%; height: 255px; bottom: 0; } [off-canvas*=left] { width: 255px; height: 100%; top: 0; left: 0; } [off-canvas*=reveal] { z-index: 0; } [off-canvas*=push] { z-index: 1; } [off-canvas*=overlay] { z-index: 9999; } /** * animation */ [canvas], [off-canvas] { -webkit-transform: translate( 0px, 0px ); -ms-transform: translate( 0px, 0px ); transform: translate( 0px, 0px ); -webkit-transition: -webkit-transform 300ms ease; transition: transform 300ms ease; -webkit-backface-visibility: hidden; /* prevents flickering may removed if having problems fixed background images in chrome. */ } /** * print */ @media print { [canvas] { -webkit-transform: translate( 0px, 0px ) !important; -ms-transform: translate( 0px, 0px ) !important; transform: translate( 0px, 0px ) !important; } [off-canvas] { display: none !important; } } i've website within div called
, nav looks this;
nav{ left: 0; top: 0; right: 0; position: fixed; z-index: 100; box-sizing: border-box; border-bottom: 1px solid #eee; background: -webkit-linear-gradient(left,rgba(10,21,31, 0.8), rgba(12,53,72, 0.8), rgba(38,74,81, 0.8)); background: -o-linear-gradient(left,rgba(10,21,31, 0.8), rgba(12,53,72, 0.8), rgba(38,74,81, 0.8)); background: -moz-linear-gradient(left,rgba(10,21,31, 0.8), rgba(12,53,72, 0.8), rgba(38,74,81, 0.8)); background: linear-gradient(to right, rgba(10,21,31, 0.8), rgba(12,53,72, 0.8), rgba(38,74,81, 0.8)); color: #fff } the html menu (coming left, not nav) looks like;
<div off-canvas="sb-1 left reveal" id="menu"> <div class="icono-cross close-any"></div> </div> and nav;
<nav></nav>
Comments
Post a Comment