facebook

Problem with expandable contents.

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #327080 Reply

    Pao-lo
    Member

    Hi. I’m struggling against an expandable menu that I customized in the home-page of my project. I created this function that hides and shows menu at a listItem click:

    function expand(itemToExpand, itemToClick)  {
      
      $(itemToExpand).hide();
        // mostro i sottomenu del blocco principale 1
       $(itemToClick).click(
          function() {
            if ($(itemToExpand).is(":hidden")) 
              $(itemToExpand).slideDown(); 
            else $(itemToExpand).slideUp();
          });
    }

    In phoneui.prePageTransition of my home-page there’s the function call, with two parameters (a “#panel” and a “listItem”). This works when I go to a second page where are the listItem e the contents to hide/show, but when a I come back to the home-page and return to the second one, the menu quickly shows and hides its contents at the listItem click, without stopping.
    How can I solve it?

    #327083

    Pao-lo
    Member

    Little update:
    The menu works (going between the two pages) replacing jquery methods with similar javascript function:

    
    document.getElementById(panelId).style.display = 'none';
      document.getElementById(listItemId).onclick = function() { 
        if(document.getElementById(panelId).style.display == 'none')
          document.getElementById(panelId).style.display = 'block';
        else
          document.getElementById(panelId).style.display = 'none';
        }
    

    but obviously the animation is lost.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Problem with expandable contents.

You must be logged in to post in the forum log in