modular-admin-html
modular-admin-html copied to clipboard
Window.onTop(X,Y) - Header and sidebar fixed
Hi!
I've a question about the template, I wish to do "window.onTop(0,0)" to move the scroll when the user change between pages but it doesn't work due to the page (layout container) are in the top (0,0).
This problem appear in all case studies (header and sidebar fixed and static). Any suggest?
The temporal solution which I've found is the following:
body {
padding: 0;
margin: 0;
//height: 100%;
min-height: 100%;
font-family: 'Open Sans', sans-serif;
color: $color-text;
overflow-x: hidden;
}
.main-wrapper {
width: 100%;
position: absolute;
// height: 100%;
overflow-y: auto;
overflow-x: hidden;
}
I've commented height
property, so, the scroll used is from window instead of content.
Could this provoked a major error in the future? Thanks!
Was just going to suggest something similar :)) One more option is to remove
width: 100%;
position: absolute;
height: 100%;
overflow-y: auto;
overflow-x: hidden;
from .main-wrapper class
I guess I've applied those rules to .main-wrapper, because the main scrollbar on the right was becoming overlapped by fixed header.
Hi @modularcoder,
you're right, the only difference that I've found is the scrollbar goes under the fixed header but now you could use plugins like (infinite-scroll) or scrollTo when change the route when you have a SPA in any framework or vanillaJS.
I think that it would be a bit loss in design which is so much good in the logic of you app. At the moment, I don't know another solution.
@Caballerog
Yep, this is something I'll think about in future V2 release. Thanks for opening this topic. Will leave this issue open for now.
Regards Gevorg