Connecting Tech Pros Worldwide Help | Site Map

Image doubt

rsrinivasan's Avatar
Familiar Sight
 
Join Date: Mar 2007
Location: India
Posts: 221
#1: May 17 '07
Hi,

In my Project I displayed an image for Menu. But what i need is the content of image is dynamic. How to do it?. Whether it is possible or not.

Thanks,
Srinivasan r.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: May 17 '07

re: Image doubt


What do you mean by dynamic?
rsrinivasan's Avatar
Familiar Sight
 
Join Date: Mar 2007
Location: India
Posts: 221
#3: May 17 '07

re: Image doubt


Quote:

Originally Posted by acoder

What do you mean by dynamic?

Hi,
Dynamic means the content of the image is different over time.

Thanks,
Newbie
 
Join Date: Dec 2006
Posts: 13
#4: May 17 '07

re: Image doubt


Quote:

Originally Posted by rsrinivasan

Hi,
Dynamic means the content of the image is different over time.

Thanks,

I'm sill unsure what you mean by "Dynamic". If you want it to change, you could precode a bunch of URL's and randomly choose an image after the "dynamic" time period.
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#5: May 18 '07

re: Image doubt


To change a displayed image, assign your image an id:

Expand|Select|Wrap|Line Numbers
  1. <img id="theBigPicture" alt="and you're missing it!" src="somefile.jpg" />
  2.  
Then change the src of the image via javascript:

Expand|Select|Wrap|Line Numbers
  1. document.getElementById('theBigPicture').src = 'someotherfile.jpg';
  2.  
Reply


Similar JavaScript / Ajax / DHTML bytes