Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Tip: Adjusting the width of pull-down menu

    By default, the width of a pull-down menu is determined by the longest option under the menu.

    What if you want to adjust the width to make it look & align better with other elements on your page?

    Unfortunately setting the width of <select> does no good.
    You can, however, set the width of the <option>s to actually control the width of the pull-down menu.

    For example, if you want to adjust the width of the "Limit to Category" pull-down menu in Advanced Search page, open
    includes/templates/YOUR_TEMPLATE/templates/tpl_advanced_search_default.php

    (If you're using template_default, you're strongly suggested to create YOUR_TEMPLATE for overriding)

    and find
    PHP Code:
    <?php echo zen_draw_pull_down_menu('categories_id'zen_get_categories(array(array('id' => '''text' => TEXT_ALL_CATEGORIES)), '0' ,'''1'), $sData['categories_id']); ?>
    Add an identifer by changing the code to
    PHP Code:
    <?php echo zen_draw_pull_down_menu('categories_id'zen_get_categories(array(array('id' => '''text' => TEXT_ALL_CATEGORIES)), '0' ,'''1'), $sData['categories_id'], 'id="advancedSearchCat"'); ?>
    Finally, add the following to your stylesheet:
    Code:
    #advancedSearchCat {width: 235px}		
    #advancedSearchCat option {width: 235px}
    That should do it.

    You need to add both lines and change the widths in your stylesheet to work properly in both IE and FF.

    Good luck,

    Susan
    Last edited by susan767; 23 Feb 2009 at 05:07 AM.

  2. #2
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: Tip: Adjusting the width of pull-down menu

    Great tip. i assume it can be applied to almost all zc dynamically generated elements .

 

 

Similar Threads

  1. v139f Please select a state from the States pull down menu
    By AnglersCorner in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2015, 04:20 PM
  2. Please select a state from the States pull down menu.
    By Veronika7747 in forum Managing Customers and Orders
    Replies: 5
    Last Post: 23 Oct 2009, 09:58 PM
  3. Replies: 6
    Last Post: 30 Jun 2008, 03:11 PM
  4. You must select a country from the Countries pull down menu
    By pod166 in forum Managing Customers and Orders
    Replies: 40
    Last Post: 4 May 2007, 01:41 AM
  5. You must select a country from the Countries pull down menu.
    By Melissa Baker in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Feb 2007, 10:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg