Web Analytics Made Easy -
StatCounter dynamic font resizing in menu bar - CodingForum

Announcement

Collapse
No announcement yet.

dynamic font resizing in menu bar

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

  • dynamic font resizing in menu bar

    Hi Guys,
    I have a multi language cms site and need to be able to resize font to fit the div its contained in so eg if I have a 300px wide navbar with 13px text:

    home | about | contact | services | products

    and in Russian its:

    fgfgdg |gghgfdhggghgfhgfh | gfg |gfdgfgdfgfdgffd dgfdgdg | gdfgfgdfgfgdfg

    I would like the font size to reduce down to fit the 300px fixed width div from say 13px to 10px or whatever fits.

    so it would be like:

    fgfgdg |gghgfdhggghgfhgfh | gfg |gfdgfgdfgfdgffd dgfdgdg | gdfgfgdfgfgdfg

    I was looking at http://jsfiddle.net/e8B9j/2/show/ and was hoping someone could get it to work to suit the above. So as above u'd have say 5 menu item divs nested in a navbar div

    Code:
    <div id="navbar">
    
    <div class="menuItem">item</div>
    <div class="menuItem">item</div>
    <div class="menuItem">item</div>
    <div class="menuItem">item</div>
    <div class="menuItem">item</div>
    </div>
    
    ...or using ul and li's
    Any help greatly appreciated. Perhaps a jquery solution out there?
    Thanks
Working...
X
😀
🥰
🤢
😎
😡
👍
👎