/    Sign up×
Community /Pin to ProfileBookmark

.gif-File doesn’t play if I call it via javascript

Hi guys,

i have a hidden div-tag in my html code.
when somebody clicks the Submit-button in the form, the function dispProgress() is called to unhide the div-tag.
This is working pretty good.
But for some reason the gif-animation in the div-tag doesn’t start to play in IE6. Why doesn’t the gif play???? its working fine in Firefox bur just not in IE ???

Thanks for help,
here is the code

[CODE]

<script type=”text/javascript”>
function dispProgress()
{
document.getElementById(“divtag”).style.display = “block”;
document.getElementById(“gif”).style.visibility = “visible”;
}
</script>

<div id=”divtag” style=”display:none; position:absolute;”>
<img id=”gif” src=”/templates/multilingual/images/Uploadbar.gif” /><br>
</div>

<form>
<input type=”submit” name=”start_upload” onClick=”javascript:dispProgress();” />
</form>

[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@RobDavidApr 09.2007 — Thats a classic problem that I've just given up trying to find a solution to.

Best solution I could find is to just display a static image?

IE won't / doesn't play gif animation during submit of a form...nor will it play gifs during intense javascript processes. I don't know why?

I think you can use javascript animation effects on a form submit though? go figure...

...I've used something like this in the past...Which just changes the colors of a 'message' one letter at at time. (cheesy, in know)

[B]head section[/B]

<!--

var message="processing";

var n=0;

function setBaseColor(){

for (i=0;i<message.length;i++){

document.getElementById("h"+i).style.color="#BBBBBB";

}

}

/////////////////////////////////////////////////////////////////////////

function highlight(){

document.getElementById("h"+n).style.color="#660033";

if (n<message.length - 1){

n = n +1;

setTimeout("highlight()",100);

}else{

n=0;

beginHighlight();

}

}

//////////////////////////////////////////////////////////////////////////////

function beginHighlight(){

setTimeout("setBaseColor()",400);

setTimeout("highlight()",400);

}

function submitForm(){

document.forms[0].submit();

beginHighlight();

}

///////////////////////////////////////////////////

[B]body section[/B]

<script type="text/javascript">

for (m=0;m<message.length;m++){

document.write("<span class='message' id='h"+m+"'>"+message.charAt(m)+"</span>");

}</script>
×

Success!

Help @blibo12345 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.18,
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,
)...