Loading ...
Sorry, an error occurred while loading the content.

Problem with menu maxheight configuration property

Expand Messages
  • mohan kumar
    Hi,  I want to set maxheight for menu. The following code is not working even if i set maxheight property.  YAHOO.util.Event.onAvailable( rendertarget ,
    Message 1 of 2 , Aug 22, 2008
    • 0 Attachment
      Hi,

       
      I want to set maxheight for menu. The following code is not working even if i set maxheight property.

       YAHOO.util.Event.onAvailable("rendertarget", function () {



              var oMenu = new YAHOO.widget.Menu("basicmenu", { fixedcenter: true ,maxheight:2});



              oMenu.addItems([

                      { text: "Yahoo! Mail", url: "http://mail.yahoo.com" },
                      { text: "Yahoo! Address Book", url: "http://addressbook.yahoo.com" },
                      { text: "Yahoo! Calendar", url: "http://calendar.yahoo.com" },
                      { text: "Yahoo! Notepad",  url: "http://notepad.yahoo.com" }

                  ]);



              oMenu.render("rendertarget");



              oMenu.subscribe("show", oMenu.focus);


              YAHOO.util.Event.addListener("menutoggle", "click", oMenu.show, null, oMenu);

          });

      I want to display only two item in the menu so i set maxheight property. But is not working.
      Let me know If i have to set any ohter property along with maxheight.I even set minscrollheight property as 1. but it is not working.


      Thanks,
      Mohan

       

       

    • Todd Kloots
      Mohan - Your value for maxheight is too low. It has to be greater than the value for minscrollheight (which by default is 90). Did you read this section of
      Message 2 of 2 , Aug 25, 2008
      • 0 Attachment
        Mohan -

        Your value for maxheight is too low. It has to be greater than the
        value for minscrollheight (which by default is 90). Did you read this
        section of the Menu landing page?

        http://developer.yahoo.com/yui/menu/#usingmaxheight

        - Todd

        mohan kumar wrote:
        >
        > Hi,
        >
        > I want to set maxheight for menu. The following code is not working
        > even if i set maxheight property.
        >
        > YAHOO.util.Event.onAvailable("rendertarget", function () {
        >
        >
        >
        > var oMenu = new YAHOO.widget.Menu("basicmenu", { fixedcenter:
        > true ,maxheight:2});
        >
        >
        >
        > oMenu.addItems([
        >
        > { text: "Yahoo! Mail", url: "http://mail.yahoo.com" },
        > { text: "Yahoo! Address Book", url:
        > "http://addressbook.yahoo.com" },
        > &nb sp; { text: "Yahoo! Calendar", url:
        > "http://calendar.yahoo.com" },
        > { text: "Yahoo! Notepad", url:
        > "http://notepad.yahoo.com" }
        >
        > ]);
        >
        >
        >
        > oMenu.render("rendertarget");
        >
        >
        >
        > oMenu.subscribe("show", oMenu.focus);
        >
        >
        > YAHOO.util.Event.addListener("menutoggle", "click",
        > oMenu.show, null, oMenu);
        >
        > });
        >
        > I want to display only two item in the menu so i set maxheight
        > property. But is not working.
        > Let me know If i have to set any ohter property along with maxheight.I
        > even set minscrollheight property as 1. but it is not working.
        >
        >
        > Tha nks,
        > Mohan ||
        >
        >
        > ||
        >
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.