Comments (4)
Ah I see, when the menu opens, if you have pushContent
option enabled, the container element gets transform
property which displaces any fixed child element.
Here is the explanation of why that's happening: https://stackoverflow.com/questions/15194313/transform3d-not-working-with-position-fixed-children/15256339#15256339
So a workaround would be something like this:
var $fixed_header = $('#fixed-header'); // your fixed header element
var $container = $('#container'); // element that you've set to pushContent
Nav.on('toggle', function(e, settings) {
if (e.data.action == 'open') {
$fixed_header.css('top', -$container.offset().top);
}
});
Nav.on('close', function(e, settings) {
$fixed_header.css('top', 0);
});
from hc-offcanvas-nav.
Can you provide me with some demo so I can check what's happening?
from hc-offcanvas-nav.
Hi,
I also saw this happening to me as well, but I think this is the expected behavior, so I have no problems with it.
If you open the menu on the top of the page (without any scrolling), the fixed header won't disappear, but if you scroll down, then open the menu there, the fixed header disappears.
from hc-offcanvas-nav.
You can try to fix this bug with thoses lines of code (jQuery) :
// Resize
function resize() {
// Sticky Fix
var headerHeight = $('.header').outerHeight();
$('.header').css('position', 'fixed');
$('.header').next().css('margin-top', headerHeight + 'px');
}
window.addEventListener('resize', resize);
resize();
from hc-offcanvas-nav.
Related Issues (20)
- Preven menu closing when press "Esc" HOT 5
- "Uncaught TypeError: Nav.close is not a function" HOT 2
- How to add html object to navTitle ? HOT 1
- BACK menu item not accessible with TAB key HOT 1
- data attributes conflict
- Styling exception on safari HOT 1
- Breaks functionality of leafletjs
- Attach menu onto some other parent than body HOT 1
- External links and rich text in menu items HOT 1
- Menu scroll / overflow HOT 3
- Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. HOT 9
- levelTitleAsBack works only in first submenu
- is there a way to always show the logo on navTitle and close button on all levels? HOT 1
- Tab order going through page when navigation is open HOT 2
- Menu always open
- The header menu is firing twice affecting performance issues
- Overlap function HOT 1
- closeOnClick does nothing HOT 1
- replace menu icon HOT 1
- WordPress and Gravity Forms conflict [Mobile Only] HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hc-offcanvas-nav.