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

Re: [ydn-javascript] MenuBar: Render problem: bd height is incorrectly set explicitly

Expand Messages
  • Todd Kloots
    Hi Larry - Looked into this one for you and it appears that the problem is just a misunderstanding on your part regarding how Menu works. The core problem was
    Message 1 of 2 , Dec 9, 2008
    • 0 Attachment
      Hi Larry - 

      Looked into this one for you and it appears that the problem is just a misunderstanding on your part regarding how Menu works.  The core problem was that you were confusing the render target with the node passed to the Menu constructor.  Per the instructions on the Menu landing page: If you are building a Menu from JavaScript, the first argument passed to the Menu's constructor is the id of the DOM element to be created by Menu, not the element in the DOM where you want your Menu instance to be placed.  The argument you pass to the "render" method determines the Menu's placement in the DOM.

      So, in your code you provided the following markup to start:

      <div class="yui-g yui-skin-sam "> 
      <div class="yuimenubar yuimenubarnav" id="menubar_here"></div>     
      </div>


      Which should have been just:

      <div class="yui-g yui-skin-sam" id="menubar_here"></div>

      Additionally, a couple of house keeping things that can help you:

      1) You had some malformed markup in your example - couple of extra </div> elements

      2) You were stamping both the <body> element and the <div> that was the render target for the Menu with the "yui-skin-sam" class name when you only needed one.

      3) You don't need to use YAHOO.util.Dom.get("menubar_here") when calling the "render" method.  You can pass the ID directly and Menu will lookup the reference for you.


      Take a look at this example (based on your original example) to see how all of the corrections came together :



      Lastly, remember that YUI doesn't current support Google's Chrome browser.

      I hope that helps.

      - Todd

      On Nov 19, 2008, at 1:36 PM, larry_kluger wrote:

      Hi,

      MenuBar 2.6.0 sometimes (pretty frequently) does not render correctly 
      on webkit browsers (Safari / Win and Chrome / Win, at least). I wasn't 
      able to track down the specific cause, but I do have a repeatable test 
      case. Screenshots of the bug too. I also have a work-around.

      See bug report 2315492

      https://sourceforge .net/tracker/ index.php?
      func=detail& aid=2315492& group_id= 165715&atid= 836476

      Regards,

      Larry


    Your message has been successfully submitted and would be delivered to recipients shortly.