Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
badjuju

CoolMenu - Auto Resize Width

Recommended Posts

I'm using coolmenu and some category names are shorter than others - some are almost double. The problem with using a hardcoded width is for smaller texts, there's too much space after the category name.

 

Using javascript, how do I resize the width of sublevels so that it automatically takes the width of the largest category name.

 

I tried modifying coolmenu.php so it reads:

for ($i=1; $i<SUB_CATEGORIES; $i++) {

$strlen = $categories['text'].length;

echo'

oCMenu.level[' . $i . ']=new cm_makeLevel()

   oCMenu.level[' . $i . '].width="$categories['text'].length"



OR



// oCMenu.level[' . $i . '].width="strlen($categories['text'])"

 

Please help.

 

Thanks in advance

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×