syn_apse
11-09-2003, 04:35 PM
im trying to write a function to fade and image's opacity on different layers of the same page according to the pointer's position to the center of that particular image. but i'm fairly new to javascripting and don't know all of the syntax that would be involved. i have the following snippet of code that i found embedded in a different type of image fading script:
if(ie5){
imgs.style.filter="alpha(opacity=0)";
imgs.filters.alpha.opacity = opacity;
}
if(ns6){
imgs.style.MozOpacity = 0 + '%';
imgs.style.MozOpacity = opacity + '%';
i assume that this is the actual syntax needed to change the opacity of the image in question. what i would like to know is how to grab both the image and the mouse position in such a way that the effect can work on different image layers at the same time, probably with different center points.
the goal is to have a single function that works as on onMouseOver, but i don't know how to get the script to grab that particular image's height and width (and therefore the centerpoint).
i know this is alot, but any help would be appreciated..
if(ie5){
imgs.style.filter="alpha(opacity=0)";
imgs.filters.alpha.opacity = opacity;
}
if(ns6){
imgs.style.MozOpacity = 0 + '%';
imgs.style.MozOpacity = opacity + '%';
i assume that this is the actual syntax needed to change the opacity of the image in question. what i would like to know is how to grab both the image and the mouse position in such a way that the effect can work on different image layers at the same time, probably with different center points.
the goal is to have a single function that works as on onMouseOver, but i don't know how to get the script to grab that particular image's height and width (and therefore the centerpoint).
i know this is alot, but any help would be appreciated..