/    Sign up×
Community /Pin to ProfileBookmark

Script doesn’t work in Firefox

I have a javascript function that can fade images… it works in IE, but it doesn’t work in firefox. Can anyone tell my why this script doesn’t work in Firefox? Please?

function fade(object, destOp, rate, delta)
{
if (!document.all)
return

if (object != “[object]”)
{
setTimeout(“fade(“+object+”,”+destOp+”,”+rate+”,”+delta+”)”,0);
return;
}

clearTimeout(FadeTimers[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)
{
FadeObjects[object.sourceIndex]=object;
FadeTimers[object.sourceIndex]=setTimeout(“fade(FadeObjects[“+object.sourceIndex+”],”+destOp+”,”+rate+”,”+delta+”)”,rate);
}
}

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@JPnycDec 21.2004 — Because you have a script written to reject anything that isn't IE (or a some versions of Opera). This line says if it's not IE, forget about it:

if (!document.all)

return
Copy linkTweet thisAlerts:
@pj59Dec 21.2004 — [i]Originally posted by DUNSEL [/i]

[B]Because you have a script written to reject anything that isn't IE (or a some versions of Opera). This line says if it's not IE, forget about it:



if (!document.all)

return [/B]
[/QUOTE]
It is not only that. If that line wasn't there or if it was modified to deal with non IE browsers as well, it would still be usefull to have a look at this thread (in which you, DUNSEL, were also involved ?):

http://www.webdeveloper.com/forum/showthread.php?s=&threadid=51800&highlight=opacity+mozilla

Regards PJ
Copy linkTweet thisAlerts:
@JPnycDec 21.2004 — ? Yeah, you're right. I didn't bother to read past that 1st statement. That said to me "if you ain't IE, turn back" so I disregarded what came after, much as any non IE browser would?
Copy linkTweet thisAlerts:
@pj59Dec 21.2004 — Maybe you really are "remarkably unconcerned" ?

By the way: congratulations to having become a Super Moderator!

Greetz PJ :p
Copy linkTweet thisAlerts:
@JPnycDec 21.2004 — Thanks! I like this place a lot. Best I.T. forum I'd found.
×

Success!

Help @lostbinary spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...