Fixed Header and Mega Menu
I'm new at magento. I'm using luma theme as a blank. I want to fix header and mega menu when page scroll down.
Thanks for your helps.
magento2 javascript menu header
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm new at magento. I'm using luma theme as a blank. I want to fix header and mega menu when page scroll down.
Thanks for your helps.
magento2 javascript menu header
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm new at magento. I'm using luma theme as a blank. I want to fix header and mega menu when page scroll down.
Thanks for your helps.
magento2 javascript menu header
I'm new at magento. I'm using luma theme as a blank. I want to fix header and mega menu when page scroll down.
Thanks for your helps.
magento2 javascript menu header
magento2 javascript menu header
edited Jan 12 '17 at 11:08
Nitin Pawar
77111435
77111435
asked Jan 12 '17 at 11:05
copencopen
11
11
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Have you tried position:fixed
in css file?
frontend/Magento/luma/en_US/css/styles-l.css
add a comment |
Create a custom.js file and place it in your app/design/Custom/theme/web/js folder. Then, from Magento_Theme/layout/default_head_blocks.xml link to your custom JS file like this:
<head>
<link src="js/custom.js" />
</head>
Alternatively, you can place the link in Admin >> Content >> Configuration > on the default scope to the right of your theme name click on "edit". Open the HTML head tab and in the "Scripts and Style Sheets" box place your script link.
Inside your custom.js file add the following code:
$(document).ready(
function() {
var mn = $(".page-header");
var mns = "main-nav-scrolled";
$(window).scroll(function() {
if( $(this).scrollTop() > 0 ) {
mn.addClass(mns);
} else {
mn.removeClass(mns);
}
});
});
Use css class .main-nav-scrolled to style the fixed menu and add any transitions and animations.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f154441%2ffixed-header-and-mega-menu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Have you tried position:fixed
in css file?
frontend/Magento/luma/en_US/css/styles-l.css
add a comment |
Have you tried position:fixed
in css file?
frontend/Magento/luma/en_US/css/styles-l.css
add a comment |
Have you tried position:fixed
in css file?
frontend/Magento/luma/en_US/css/styles-l.css
Have you tried position:fixed
in css file?
frontend/Magento/luma/en_US/css/styles-l.css
edited Jan 13 '17 at 4:40
Ankit Shah
4,655861139
4,655861139
answered Jan 12 '17 at 11:45
AytacAytac
112
112
add a comment |
add a comment |
Create a custom.js file and place it in your app/design/Custom/theme/web/js folder. Then, from Magento_Theme/layout/default_head_blocks.xml link to your custom JS file like this:
<head>
<link src="js/custom.js" />
</head>
Alternatively, you can place the link in Admin >> Content >> Configuration > on the default scope to the right of your theme name click on "edit". Open the HTML head tab and in the "Scripts and Style Sheets" box place your script link.
Inside your custom.js file add the following code:
$(document).ready(
function() {
var mn = $(".page-header");
var mns = "main-nav-scrolled";
$(window).scroll(function() {
if( $(this).scrollTop() > 0 ) {
mn.addClass(mns);
} else {
mn.removeClass(mns);
}
});
});
Use css class .main-nav-scrolled to style the fixed menu and add any transitions and animations.
add a comment |
Create a custom.js file and place it in your app/design/Custom/theme/web/js folder. Then, from Magento_Theme/layout/default_head_blocks.xml link to your custom JS file like this:
<head>
<link src="js/custom.js" />
</head>
Alternatively, you can place the link in Admin >> Content >> Configuration > on the default scope to the right of your theme name click on "edit". Open the HTML head tab and in the "Scripts and Style Sheets" box place your script link.
Inside your custom.js file add the following code:
$(document).ready(
function() {
var mn = $(".page-header");
var mns = "main-nav-scrolled";
$(window).scroll(function() {
if( $(this).scrollTop() > 0 ) {
mn.addClass(mns);
} else {
mn.removeClass(mns);
}
});
});
Use css class .main-nav-scrolled to style the fixed menu and add any transitions and animations.
add a comment |
Create a custom.js file and place it in your app/design/Custom/theme/web/js folder. Then, from Magento_Theme/layout/default_head_blocks.xml link to your custom JS file like this:
<head>
<link src="js/custom.js" />
</head>
Alternatively, you can place the link in Admin >> Content >> Configuration > on the default scope to the right of your theme name click on "edit". Open the HTML head tab and in the "Scripts and Style Sheets" box place your script link.
Inside your custom.js file add the following code:
$(document).ready(
function() {
var mn = $(".page-header");
var mns = "main-nav-scrolled";
$(window).scroll(function() {
if( $(this).scrollTop() > 0 ) {
mn.addClass(mns);
} else {
mn.removeClass(mns);
}
});
});
Use css class .main-nav-scrolled to style the fixed menu and add any transitions and animations.
Create a custom.js file and place it in your app/design/Custom/theme/web/js folder. Then, from Magento_Theme/layout/default_head_blocks.xml link to your custom JS file like this:
<head>
<link src="js/custom.js" />
</head>
Alternatively, you can place the link in Admin >> Content >> Configuration > on the default scope to the right of your theme name click on "edit". Open the HTML head tab and in the "Scripts and Style Sheets" box place your script link.
Inside your custom.js file add the following code:
$(document).ready(
function() {
var mn = $(".page-header");
var mns = "main-nav-scrolled";
$(window).scroll(function() {
if( $(this).scrollTop() > 0 ) {
mn.addClass(mns);
} else {
mn.removeClass(mns);
}
});
});
Use css class .main-nav-scrolled to style the fixed menu and add any transitions and animations.
answered Oct 17 '17 at 16:34
Iveta AllogenesIveta Allogenes
10011
10011
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f154441%2ffixed-header-and-mega-menu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown