PDA

View Full Version : gradual fading image



snake
03-26-2006, 04:41 AM
hi i am new around here... sorry if i post it in the wrong place.
i have a xanga site:
http://www.xanga.com/snakeseasoft82

and i tried to use the script from: http://www.dynamicdrive.com/dynamicindex4/highlightgrad2.htm

i am puzzled because the image stayed transparent despite hovering on it.
is it that the script is incompatible for online diary or did i do something wrong? thanks very much

jscheuer1
03-26-2006, 05:01 AM
I notice you appear to have other script(s) on the page, could be a script conflict. I really didn't want to wait around for the .wav to load to find out for sure what the problem was.

Twey
03-26-2006, 11:55 AM
I really didn't want to wait around for the .wav to load to find out for sure what the problem was.Ouch. snake: that script is outdated and browser-restrictive for no good reason. Use this (http://www.dynamicdrive.com/forums/showpost.php?p=29371&postcount=15) one of mine instead.

snake
03-26-2006, 03:09 PM
thanks alot twey. but i am a total computer idiot.
i had difficulty understanding your script. so where and what should i put in the head and what should i put behind the image img src=XXX...?
thanks a bunch!!!

Twey
03-26-2006, 03:33 PM
In the head:
<script type="text/javascript" src="FadableObject.js"></script>
<script type="text/javascript">
var fn = function() {
new FadableObject(document.getElementById("imageOne"), 1, 10, 30, 99, true, false);
};

if (window.attachEvent) window.attachEvent("onload", fn);
else if(window.addEventListener) window.addEventListener("onload", fn, false);
else {
window.overriddenonload = window.onload;
window.onload = function() { fn(); window.overriddenonload(); }
}
</script>
In the body, where you want the image:
<img src="myImage.png" id="imageOne" onmouseover="this.fadeThread.fadeIn();" onmouseout="this.fadeThread.fadeOut();">