View Single Post
  #1 (permalink)  
Old April 14th, 2005, 08:30 AM
crmpicco crmpicco is offline
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Tip: How to 'grey-out' an image

+img.gif is your original image+

<style>

#photoholder
{
  width:120px;
  height:23px;
  background:url('/Trial/airlogo/img.gif') 99% 1%;
}
#thephoto
{
  width:120px;
  height:23px;
}
</style>

-----------------------------------

<script>
////////////////////////////////////////////
// 'Disabled' image code //
////////////////////////////////////////////

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;

  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";

  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;

  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;

  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}
function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 75; // the level of darkness (100 - high, 0 - low)
      window.setTimeout("fadeIn('"+objId+"',"+opacity+") ", 100);
    }
  }
}

function initImage() {
  imageId = 'thephoto';
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}


window.onload = function() {initImage()}
document.write("<style type='text/css'>#thephoto {visibility:hidden;} </style>");
</script>

--------------------------------------

<div id="photoholder">
<img src="/Trial/airlogo/white.gif" id="thephoto">
</div>

+ This is the image that will 'grey-out' your original image+


www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote