Results 1 to 5 of 5

Thread: use a background image for AnyLink Drop Down Menu

  1. #1
    Join Date
    Nov 2008
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default use a background image for AnyLink Drop Down Menu

    1) Script Title: AnyLink Drop Down Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem:

    In the .js code you can set the hexadecimal background color in var menubgcolor='666666' and then call it with background-color:'+menubgcolor+'

    BUT, I want to make a nice background image that would run the entire length of the drop down menu (no matter if 2 or 10 drop down choices). What alterations would need to be made to this script to use a background image rather than a background color? I would think it would just be altering the definition of var menubgcolor='666666' in some way?

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

    Default

    I might have solved it.. but not fully tested it yet...

    In the CSS for the #dropmenudiv{ style I added the parameter background-image:url(../images/menubg.jpg) and this seems to override the var menubgcolor='666666' in the .js file
    Last edited by eTard; 11-07-2008 at 03:21 PM.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It doesn't actually override it, the background-color and the background-image are two separate style properties. All you've done is added background-image, which will generally appear to override background-color, unless the background-image isn't configured to cover the entire background area, or if it has transparent regions.

    In any event, what you've done is perfectly fine. And, as you can see, works quite well.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    eTard (11-13-2008)

  5. #4
    Join Date
    Nov 2008
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    yeah, works perfect. I checked in mac and PC and about 8 browsers..

    In my case, I made a nice top to bottom gradient faded background image about 150 pixels wide by 500 pixels tall and this covers all my drop downs, one of which is 9 options long. The 150 pixels covers the max width of my widest button.

  6. #5
    Join Date
    Nov 2008
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    also, FWIW, I also did this to the drop down roll-over color. I wanted an image, rather than a color, so in the css #dropmenudiv a:hover I changed out:

    background-color: #990000; to background-image:url(../images/menubgon.gif);

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
  •