Giter VIP home page Giter VIP logo

Comments (6)

zuramai avatar zuramai commented on August 15, 2024

Hi @ParalaX002,
You can achieve the same way like Bootstrap's documentation navbar with position: sticky.

image

As you can see in the image above, try adding position: sticky, top: 0, z-index: 5 to the navbar. And if it doesn't work, try to add display: initial to the parent element.

from mazer.

ParalaX002 avatar ParalaX002 commented on August 15, 2024

Hi, thanks a lot for your fast answer.

So it is now sticking, but I still have an issue: it is on the bottom or on the top of the sidebar. That is, either the sidebar "covers" the top bar, or the top bar covers the sidebar.

I've got this code (sorry I'm no html5 dev, so it might be really bad...)

<body>

<div id="app" style="display: initial">        
    <nav class="bd-subnavbar" style="position:sticky; top:0; z-index:5">
        <div class="card">
            Some stuffs
        </div>
    </nav>
        
    <div id="sidebar" class="active">
        <div class="sidebar-wrapper active">
            <div class="sidebar-menu">

from mazer.

zuramai avatar zuramai commented on August 15, 2024

Do you have any screenshot how it would look like?

from mazer.

ParalaX002 avatar ParalaX002 commented on August 15, 2024

Here it is if I set the bar bellow the sidebar:
image

Or, if I put it on top:
image
To put it on top, I add the class "sticky-top" to the "bd-subnavbar", like this:
<nav class="bd-subnavbar sticky-top">

As you can see, either the logo is dropped, or the begining of the sidebar. I can play with some margin and padding, but then it doesn't looks nice when I resize the window...

from mazer.

zuramai avatar zuramai commented on August 15, 2024

You can try to set a background to the navbar, and set a full width.

Another option:
If you need navbar in Mazer, you can take layout-vertical-navbar.html as reference.

The structure is to make navbar is like this:

<div id="app">
    <div id="sidebar" class="active">
        <div class="sidebar-wrapper active">
                 // Sidebar items
        </div>
    </div>
    <div id="main" class='layout-navbar'>
        <header class='mb-3'>
            <nav class="navbar navbar-expand navbar-light ">
                   // Your bootstrap navbar here
            </nav>
        </header>

        // app content..
</div>

from mazer.

ParalaX002 avatar ParalaX002 commented on August 15, 2024

Hi, thanks for your help :)

I managed to get something, it's still not perfect because it is not resizing correctly to the content yet, but it'll do. Maybe it would be a good addition to create an example with both bars in your demo :)

Regards

from mazer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.