PDA

View Full Version : Gradual Element Fader



CharlotteS
08-17-2009, 10:59 AM
Hi!

I'v used the Gradual Element Fader and it's working fine, except for one thing...

I've used the script on a picture, which I also have used Hotspot area in DW to link diffrent parts of the picture. The effect works fine on mouseroll over, but when the mouse is over a link it fades away... I want the picture to be completely visible, but I still want to be able to link diffrent parts of the image: http://magnanima.se/html/nya/forum.html

Anyone have a solution? Thanks!

ddadmin
08-17-2009, 09:00 PM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

The problem from what I can tell is that an image map overlays the image it's associated wtih (instead of being part of it), so the script thinks the two are separate. As a result, when you move the mouse over the image map, the script thinks you've actually moved the mouse out of the fading element and into another element, hence the fade out.

Inside the .js file, try changing the function:


gradualFader.fadeinterface=function(obj, e, direction){
if (!this.isContained(obj, e)){
gradualFader.clearTimer(obj)
gradualFader.fadeupdown(obj, direction)
}
}

to:


gradualFader.fadeinterface=function(obj, e, direction){
var e=window.event || e
var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
if (!this.isContained(obj, e) && c.tagName!="AREA"){
gradualFader.clearTimer(obj)
gradualFader.fadeupdown(obj, direction)
}
}

to manually discount image maps within an image.

CharlotteS
08-17-2009, 10:10 PM
It works, thanks for taking the time to help me! :)

//C