Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8213507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:08:30+00:00 2026-06-07T11:08:30+00:00

How can I make a navigation menu in Windows 8 Metro Javascript with header

  • 0

How can I make a navigation menu in Windows 8 Metro Javascript with header menus and section labels like the picture below?

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:08:32+00:00Added an answer on June 7, 2026 at 11:08 am

    First of is to define the HTML:

     <!-- Define the header menu -->
        <div id="headerMenu" data-win-control="WinJS.UI.Menu">
            <button data-win-control="WinJS.UI.MenuCommand" data-win-options="{id:'section1MenuItem',label:'Section page'}"></button>
            <button data-win-control="WinJS.UI.MenuCommand" data-win-options="{id:'section2MenuItem',label:'Section page'}"></button>
            <button data-win-control="WinJS.UI.MenuCommand" data-win-options="{id:'section3MenuItem',label:'Section page'}"></button>
    
            <hr data-win-control="WinJS.UI.MenuCommand" data-win-options="{id:'separator',type:'separator'}" />
            <button data-win-control="WinJS.UI.MenuCommand" data-win-options="{id:'homeMenuItem',label:'Home'}">
            </button>
        </div>
    
    
     <!-- The content that will be loaded and displayed. -->
        <header aria-label="Header content" role="banner">
            <button class="win-backbutton" aria-label="Back"></button>
            <div class="titlearea win-type-ellipsis">
                <button class="titlecontainer">
                    <h1>
                        <span class="pagetitle">Header</span>
                        <span class="chevron win-type-x-large">&#xe099</span>
                    </h1>
                </button>
                <h2 class="pagesubtitle">With neat flyin effect</h2>
            </div>
         </header>
    

    Then comes the Javascript:

       // This function is called whenever a user navigates to this page. It
       // populates the page elements with the app's data.
       ready: function (element, options) {
    
            document.querySelector(".titlearea").addEventListener("click", this.showHeaderMenu, false);
            document.getElementById("section1").addEventListener("click", function () { self.goToSection(0); }, false);
            document.getElementById("section2").addEventListener("click", function () { self.goToSection(1); }, false);
            document.getElementById("section3").addEventListener("click", function () { self.goToSection(2); }, false);
            document.getElementById("homeMenuItem").addEventListener("click", function () { self.goHome(); }, false);
    
        },
        // Binds the menu to an anchor and shows it
        showHeaderMenu: function () {
    
            var title = document.querySelector("header .titlearea");
            var menu = document.getElementById("headerMenu").winControl;
            menu.anchor = title;
            menu.placement = "bottom";
            menu.alignment = "left";
    
            menu.show();
    
        },
        // Navigate to a section
        goToSection: function (section) {
            switch (section) {
                case 1:
                    WinJS.Navigation.navigate("/pages/section1/section1.html");
                    break;
                case 2:
                    WinJS.Navigation.navigate("/pages/section2/section2.html");
                    break;
                case 3:
                    WinJS.Navigation.navigate("/pages/section3/section3.html");
                    break;
    
            }
            WinJS.log && WinJS.log("You are viewing the #" + section + " section.", "sample", "status");
    
        },
        // Go to the home screen
        goHome: function () {
    
            WinJS.Navigation.navigate("/default.html");
    
        },
    

    Just wanted to share, hope this helps someone!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a control I can use to make navigation/selection like the one under
I'd like to only get the worddpress navigation (header, navigation menu, footer) so I
I need to make subgroups in the top navigation menu, like: Home -Group --Subgroup
I would like to make a color fading navigation menu using jQuery, in which
I got a task to make two navigation menus on a site: 'Main' menu
I can make batch or vbs file on windows and run. this can automate
I want to make a navigation menu with 4 buttons using a grid layout.
To whom it may concern, I am trying to make a list navigation menu
I am trying to make a 2 level vertical navigation menu. What's happening right
I decided to make my navigation links a styled-up <ul> . How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.