Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 22nd, 2007, 09:00 AM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default Animated Gif and Javascript

Hi,

I am trying to insert an animated gif to my web page but for some reason when it is inserted it becomes static i.e. I lose the animation. Has someone experience the same problem before?

I use an empty span id=displayInd to hold the image but even if I add it inline (in the aspx code) this is happening.

<asp:Label ID="ProcessingReport" runat="server" Text="processingReport" style="display:none; clear:both" />
                        <span id="displayInd"></span>

Then in Javascript I add the image tag

function PRDisplay()
    {
        getEl("ProcessingReport").style.display = "block"
         var imagedisplay = document.getElementById('displayInd');
         imagedisplay.innerHTML = '<img id=\"indicator\" src=\"' + _appRoot + '/App_Themes/theme1/indicator.gif\" /> ';

        disableReportButtons()
    }

I would appreciate if someone could help me.

Cheers

CPALL
  #2 (permalink)  
Old March 25th, 2007, 09:19 PM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Can someone please offer some help. I still have not been able to sort the issue with the animated gif. What could cause it to stop being animated??

Cheers
  #3 (permalink)  
Old March 26th, 2007, 12:40 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Have you tried setting the src attribute of the image instead of the innerHTML??
e.g.

imagedisplay.src = PathToNewImage

where imagedisplay is an <img /> tag, not a span?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #4 (permalink)  
Old March 27th, 2007, 04:37 AM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thanks for your reply. I will try to use the src attribute instead of the innerHTML and let you know what happens. But I have tried to add this inline and it did not work. I will try using Javascript to see.

Cheers

CPall
  #5 (permalink)  
Old March 28th, 2007, 04:09 PM
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Hi Imar,

The animated gif is working now. Thanks for you tip.

Also, I have posted a topic entitled SHOW/HIDE but have received no replies yet.

Could you please have a look at that post and let me know if you can give any help.

Cheers

CPall


PathToNewImage = _appRoot + "/App_Themes/theme1/indicator.gif"
imagedisplay.src = PathToNewImage
imagedisplay.style.display = "block"


Similar Threads
Thread Thread Starter Forum Replies Last Post
Animated icon on VB form Swati Chari Beginning VB 6 7 March 16th, 2008 12:25 AM
How to use animated gifs? worldspawn C# 3 April 17th, 2007 11:54 AM
animated gif in MS Access anukagni Access 2 December 4th, 2006 06:31 AM
Animated scrolling page title joshil Flash (all versions) 1 May 14th, 2004 03:45 PM
Animated Buttons Inside Navigation Bars? Ben Horne Dreamweaver (all versions) 0 October 5th, 2003 09:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.