Staredit Network

Staredit Network -> Computers and Technical -> must... kill... javascript
Report, edit, etc...Posted by saibaman8 on 2005-10-13 at 21:54:03
CODE
function Fade(objID,CurrentAlpha,TargetAlpha,steps){

 var obj = document.getElementById(objID);
 
 CurrentAlpha = parseInt(CurrentAlpha);
 if (isNaN(CurrentAlpha)){
  CurrentAlpha = parseInt(obj.style.opacity*100);
  if (isNaN(CurrentAlpha))CurrentAlpha=100;
 }
 
 
 
 var DeltaAlpha=parseInt((CurrentAlpha-TargetAlpha)/steps);
 var NewAlpha = CurrentAlpha - DeltaAlpha;
 
 if (NewAlpha == 100 && (navigator.userAgent.indexOf('Gecko') != -1 && navigator.userAgent.indexOf('Safari') == -1)) NewAlpha = 99.99;
 
 obj.style.opacity = (NewAlpha / 100);
 obj.style.MozOpacity = obj.style.opacity;
 obj.style.KhtmlOpacity = obj.style.opacity;
 obj.style.filter = 'alpha(opacity='+NewAlpha+')';
 
 if (steps>1){
  setTimeout('Fade("'+objID+'",'+NewAlpha+','+TargetAlpha+','+(steps-1)+')', 50);
 }
}

and here is the image code
CODE
<img name="image1" src="http://squareownz.com/img/files/lordilpalazo_saibssig.jpg" style="filter:alpha(opacity=30); -moz-opacity:0.3" onMouseOver="Fade('image1','',100,5)" onMouseOut="Fade('image1','',30,5)">

it works at the place i got it from, but it doesn't work for me. any idea why?
Report, edit, etc...Posted by BSTRhino on 2005-10-14 at 02:11:07
Hmm... try changing the image code into this:

CODE
<img id="image1" src="http://squareownz.com/img/files/lordilpalazo_saibssig.jpg" style="filter:alpha(opacity=30); -moz-opacity:0.3" onMouseOver="Fade('image1','',100,5)" onMouseOut="Fade('image1','',30,5)">
Report, edit, etc...Posted by saibaman8 on 2005-10-14 at 07:26:48
yay it worked. thanks.
Report, edit, etc...Posted by BSTRhino on 2005-10-14 at 19:31:51
Whoohoo! I love answering JavaScript questions. Ask me something else!
Next Page (1)