Results 1 to 3 of 3

Thread: Chained Menu with icons

  1. #1
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Chained Menu with icons

    1) Script Title: Chained Select Menu

    2) Script URL: http://www.dynamicdrive.com/dynamici...menu/index.htm

    3) Problem:

    I would like to display small icons (actually a flag next to each country name) next to the text in one of the drop down menus. However I have tried using img tags and that doesn't work. Any ideas?
    Last edited by chrismg; 02-17-2008 at 04:27 PM. Reason: wrong url

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If you're talking about adding an image inside each OPTION tag itself, you can't just use an IMG tag to do this. One doesn't go in the other. What you can do is use a non repeating background image, and use CSS to add that background to the option. For example:

    Code:
    <select>
    <option style="background: url(usa.gif) left center no-repeat; padding-left: 30px">This is an option</option>
    <option style="background: url(canada.gif) left center no-repeat; padding-left: 30px">This is an option as well</option>
    </select>
    The "30px" is to provide enough space, so the background image and OPTION text don't overlap. This is the gist anyway.

  3. #3
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply, I'll try that

    Chris

Bookmarks

Posting Permissions

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