Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2012, 06:13 PM   PM User | #1
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,191
Thanks: 217
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
displaying image

Am i even close here lol i so suck at javascript lol

Code:
 var img = document.createElement('img');
      img.src = "/images/loader.gif";
      img.width = 32;
      img.height = 32;

      document.getElementById("showimage").value="img";
and of course the above is not working lol I think the prob is in my value =

Last edited by durangod; 11-06-2012 at 10:48 PM..
durangod is offline   Reply With Quote
Old 11-06-2012, 06:30 PM   PM User | #2
Calvert Tripesi
New Coder

 
Join Date: Jan 2011
Posts: 51
Thanks: 0
Thanked 9 Times in 9 Posts
Calvert Tripesi is an unknown quantity at this point
If you create an img element, then you need to append it to a parent element
Code:
 var img = document.createElement('img');
      img.src = "/images/loader.gif";
      img.width = 32;
      img.height = 32;

      document.body.appendChild( img );
Is that what you're trying to do?
Calvert Tripesi is offline   Reply With Quote
Users who have thanked Calvert Tripesi for this post:
durangod (11-06-2012)
Old 11-06-2012, 06:56 PM   PM User | #3
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,191
Thanks: 217
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
im trying to add an image to a hidden div


i cant just put the img src = because its a gif and it shows the image but it does not display the motion of the gif image just the still image so i thought if i added it to the js it would show the motion

so can i do this

Code:
function showhdiv()
{
var fval = document.FrmPicture.fileupload.value;

 if (fval)
    {
     var img = document.createElement('img');
      img.src = "/images/loader.gif";
      img.width = 32;
      img.height = 32;

     document.getElementById("vidstatus").style.display = "inline";
     document.body.appendChild( img );
      
    }

}//close function showhdiv
what i want is for the inline text to show, and then the gif image after that

the problem again is that if i do this outside the div

Code:
<img src="/images/loader.gif" border="0" alt="" />
the motion gif shows fine, but inside the div it just shows the still image (no motion) and i dont know why.

I have attached the loader.gif image for you to see
Attached Images
 

Last edited by durangod; 11-06-2012 at 06:59 PM..
durangod is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:01 PM.


Advertisement
Log in to turn off these ads.