Ankun
10-14-2002, 02:10 AM
i am trying to change the opacity of one button by hovering on another button.. the url to see what I have so far in action is: http://www.heavenly-fury.com/webdev/test.htm and below is the source for the page.
<head>
<script language="JavaScript1.2">
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
</script>
</head>
<body bgcolor="#000000">
<img border="0" src="home1.jpg" onmouseover="getElementById('image').setAttribute('src','about1.jpg'),getElementById('image').setAttribute('alt', 'nereidFade(this,100,50,4)')" onmouseout="getElementById('image').setAttribute('src','portfolio1.jpg')" width="56" height="25">
<img border="0" src="portfolio1.jpg" id="image" style="filter:alpha(opacity=50)" width="88" height="25">
---edit---
I forgot to remove the rollover of the second button, but for its purposes..when you hover on one button the second button will change to another image and the opacity of that image will gradually fade from 0 to 100 (over roughly 4 seconds)
---edit2--- i would delete the thread but it seems my stupidity didnt allow me to figure it out... :) i'm all set guys..thnx newayz
<head>
<script language="JavaScript1.2">
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
</script>
</head>
<body bgcolor="#000000">
<img border="0" src="home1.jpg" onmouseover="getElementById('image').setAttribute('src','about1.jpg'),getElementById('image').setAttribute('alt', 'nereidFade(this,100,50,4)')" onmouseout="getElementById('image').setAttribute('src','portfolio1.jpg')" width="56" height="25">
<img border="0" src="portfolio1.jpg" id="image" style="filter:alpha(opacity=50)" width="88" height="25">
---edit---
I forgot to remove the rollover of the second button, but for its purposes..when you hover on one button the second button will change to another image and the opacity of that image will gradually fade from 0 to 100 (over roughly 4 seconds)
---edit2--- i would delete the thread but it seems my stupidity didnt allow me to figure it out... :) i'm all set guys..thnx newayz