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

  • Home
  • SEARCH
  • 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 8131409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:05:02+00:00 2026-06-06T09:05:02+00:00

The menu is what I want, when mouse over the left, the right should

  • 0

image

The menu is what I want, when mouse over the left, the right should changes but doesn’t.

Here is my simplified viewmodel:

var currentSelectIndex  = 0;

var AppModel = {
    CurrentIndex: ko.observable(currentSelectedIndex),
    OnMouseOver: function (data, event) {
        // change currentIndex or currentSelectedIndex here
        // CurrentSubCategory didn't updated
    },
    CurrentSubCategory: ko.computed({
        read: function() {
            return AppModel.Menu[AppModel.CurrentIndex()].subcategory;
        },
        deferEvaluation: true
    }),
    Menu: [
    {
        subcategory: [
            { name: '1', id: 50000436 },
            { name: '2', id: 50010402 },
            { name: '3', id: 50010159 }
        ],
    }
};

And my html:

<div class="categories" id="categories">
    <div class="first-category" id="first-category">
        <ul data-bind="foreach:Menu">
            <li data-bind="text:name,attr:{id:id,class:className},event{ mouseover: $root.myfunction}"></li>
        </ul>
    </div>
    <div class="sub-category" id="sub-category">
        <ul data-bind="foreach:CurrentSubCategory()">
            <li><a data-bind="text:name,attr:{href:getListUrl(id)}"></a></li>
        </ul>
        <div class="clear">
        </div>
    </div>
    <div class="clear">
    </div>
</div>

Sorry, can’t post images due to less than 10 reputation.

Thanks for any help!

  • 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-06T09:05:04+00:00Added an answer on June 6, 2026 at 9:05 am

    There were several syntax errors in your code which I imagine are a result of your making it simpler to post.

    I have posted a working jsFiddle here: http://jsfiddle.net/Gy6Gv/2/

    I changed Menu to be an observable array only because knockout provides the helper method .indexOf to make it easier to get the index of the menu from the mouseover. Other than that there was no problem with the computed. I imagine there is some other syntactical error in your actual code.

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

Sidebar

Related Questions

Here is my site: http://www.raceramps.com/v2 Move your mouse over the menu on the right
I want that the menu i have created for testing entries should come in
I want to make a right click menu for my winforms app. It will
I want to display a menu that changes according to the user group of
I'm using the Pure CSS menu from here: http://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/ It works fine, but I
html- <div class=hbg> </div> some menu items here jquery for mouser over on menu
I have got a drop down menu which works fine but i want to
I want to build a vertical menu bar like http://users.tpg.com.au/j_birch/plugins/superfish/#examples But on the mouse
i have two buttons in menu on mouse over the button change image to
I want to add a glowing effect when I mouse over a button or

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.