0

I tried to made the category menu fixed or sticky in the top. I read this question and it's seems work, but i don't know on which file i should to add the javascript and CSS. So, which file should i add the JS and CSS file? And how can i call the JS to sticking all the category menu?

1 Answer 1

1

Just add this code to app/design/frontend/Vendor/Theme/Magento_Theme/web/js/theme.js and be sure that .CategoryNav have position relative, it's important.

$('.CategoryNav').mage('sticky', {
    container: '#maincontent',
    spacingTop: 100
});

(copy file from Luma theme with required modules 'jquery' and 'mage/mage').

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.