Two Lines Problem in Menu Items

Need to combine Javascript:

  1. Don't set specific height of <li> and <a>, so that the height will be extended automatically when two lines.
  2. Menu items must be "visible" in the beginning or "height()" will always return 0.
  3. Loop <li> to check height values. If the height is more than expected, that means the text in menu item is too long.
  4. Change "line-height" and "padding" values for items with two lines.
  5. Set specific height value if needed. e.g. The last item need different height to show full background image.