Return to Solutions Overview <-

BMG Auto Nabar fixer for Webflow

Written with jQuery/ JavaScript. Fixes your navigation bar on click and sets it back to relative with the second click. Useful for projects with GSAP smooth scroll.

(Still under development as of March 15th 2023)

<script>
/* Start of: [BMG.studio] Nav fixer */

// + Strings +

// Selectors 
const menuOpenButtonSelector = '.navbar_menu-main-button',
    menuCloseButtonSelector = '.navbar_menu-close-button',
    navBarSelector = '.navbar'

// Attributes

// Elements
const $menuOpenButton = $(menuOpenButtonSelector),
    $menuCloseButton = $(menuCloseButtonSelector),
    $navBar = $(navBarSelector)

// Values
let firstClick = true


// + Mains +
$menuOpenButton.click(() => 
{
    $navBar.css({ position: 'fixed' })

    $('head').append(`<style bmg-data="nav-fixer-css">::-webkit-scrollbar{ display: none; }</style>`)
})

$menuCloseButton.click(() => 
{
    $navBar.css({ position: 'relative' })

    $('[bmg-data = "nav-fixer-css"]').remove()
})


// + Helper +

/* End of: [BMG.studio] Nav fixer */
</script>

FAQs

You still have an open question about BMG.studio and how we operate. Chances are good that you will find what you are looking for here:

Why does this FAQ exist?

Well. As of Wednesday, March 15th 2023, I think this component looks really cool.

Can I clone this FAQ component?

Yes. Yes you can. You can do so -> here <-

Still have questions?

It's okay to reach out. Use either email or our calendar tool