• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Side Navigation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Side Navigation

    I created a side nav menu in one of my apps... Works very smoothly.....

    If i wanted to make the side menu go away if the top menu button is pressed a second time i would need to do that via scripting, correct? in other words --- i default the side menu to hidden... on click of the top button i show the side menu.... i want the next click of the top button to hide the side menu again -- like the side nav button on the Portal operates.....

    thx

  • #2
    You could create a new app variable let's say it's called "navVisible". Then on the click event of your nav menu buttons set the new app var "navVisible" to false.

    Then on your menu button execute a script that will check if it's already visible and if so hide it otherwise set your app variable to true that shows your navigation buttons.

    The below example has an app var called "hideNavButtons" that is linked to our navigation buttons and when set to null will show them otherwise if set to true will hide them.

    Code:
    var isVisible = getAppVar('navVisible'),
        hideNavButtons = getAppVar('hideNavButtons');
    
    if (Valence.isEmpty(isVisible) || isVisible === false) {
        // show the nav buttons and set navVisible to true
        //
        setAppVar('hideNavButtons', null);
        setAppVar('navVisible', true);
    } else {
        // since nav is already visible hide the nav buttons
        //  and clear navVisible
        setAppVar('hideNavButtons', true);
        setAppVar('navVisible', null);
    }

    Comment


    • #3
      that's what i was figuring.... Thanx!!!!

      Comment


      • #4
        worked like a charm!!!! thanx...

        Comment

        Working...
        X