We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Variable width button using CSS and IE AlphaImageLoader filter for hover state

TankDesign
TankDesign asked
on
Medium Priority
392 Views
Last Modified: 2010-07-27
So this client is looking for a unique solution to a variable width button problem.  To get the variable width issue resolved, I used the sliding doors CSS method to get the button to look correct.  Unfortunately what this does is break the image into separate elements, and now I have no way to control the background state of both elements.  The css is included below, and I know this works correctly in IE.  Now what I need is for the

filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image src='images/yellow.button.left.png');

to change the background element of both images.  Maybe this isn’t the best way to do this, but I need it to work properly.

Any suggestions?

<style type="text/css">
<!--
.buttonYellow {
    float:left;
    width:auto;
    font-size:11px;
    font-weight:bold;
    line-height:normal;
    }
.buttonYellow ul {
    margin:0;
    padding:0;
    list-style:none;
}
.buttonYellow li {
      float:left;
      margin:0;
      padding:0;
      background: url(images/yellow.button.right.png) no-repeat right top;
}
.buttonYellow a {
      display:block;
      background: url(images/yellow.button.left.png) no-repeat left top;
      text-decoration:none;
      color:#FFF;
      padding: 4px 11px 6px;
}
.buttonTellow a:hover {
      filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image src='images/yellow.button.left.on.png');
}
-->
  </style>

<div class="buttonYellow"><ul><li><a href="#">Charlie</a></li></ul></div>
Comment
Watch Question

Hi TankDesign, do you have a link to your page?

Author

Commented:
Absolutely.

I made a page with where I'm at plus the other images.

http://www.davekilkenny.com/tank/buttonTemp.html

Thanks for your help
here's a page on my test site that has what you're looking for, look at the view source to see how it's done...

http://www.cfusionx.com/demo/demo2.cfm

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Is there any way to get it done with the transparency filter?
alrighty, here's a link with a tutorial on how to use that gradient for IE only, this talks about buttons, but it can be adapted for tabs as well..

http://www.webreference.com/programming/css_stylish/
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.