Welcome visitor
* Login
* Register
It is currently March 26th, 2019, 10:34 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  Dinamically change an image
PostPosted: August 27th, 2009, 1:40 pm 

Posts: 25
Hi, i have a gallery with many logos and one of them is displayed on a cap. What can i do so when the user clicks another logo, that logo would be displayed on the cap?

Thank you.


Top
 Profile  
 
  Re: Dinamically change an image
PostPosted: August 27th, 2009, 6:07 pm 
User avatar

Posts: 52
suppose that this is the tag with the logo on the cap
<img src="logo1.png" id="cap" />

make your gallery tags look like this
<img src="logo2.jpg" onclick="replaceLogo(this.src);" />

then create this script
<script type="text/javascript">
function replaceLogo(n){document.getElementById('cap').src=n;}
</script>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron