Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

image swap grid

Posted on 2010-01-12
6
Medium Priority
?
241 Views
Last Modified: 2013-12-25
My client is an artist. He wants to show a a grid of 9 images on a page. On clicking on an image, he wants it to change to another image which stays. So by the time the vistor clicks all nine images, they are looking a a completely different set of images than on entry.

Can anyone give any advice on the simplest way to do this.
0
Comment
Question by:mattybrown
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 26292750
for each image link you can have a onclick event which will call the following javascript function

<img src="" onclick="changepic(this)">

function changepic(thisObj)
{
thisObj.src=img_src;
}
0
 

Author Comment

by:mattybrown
ID: 26292990
So would that mean that by clicking each of the  nine initial images you could finish up with a completely different set of nine images on the same page?

0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 26293012
Yes

Now, if the question is which image will be replacing the existing one: You might want to store those image URLs in an array.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:mattybrown
ID: 26293066
Perfect. Thank you.

One other thing though. You said: 'those image URLs in an array'. Not too sure what you mean by this. The site will be a simple HTML site.

0
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 total points
ID: 26293119
I meant that the image URLs you want to replace to can be kept in a Javascript array (in case you want different image to be replaced with at each onclick).
0
 

Author Comment

by:mattybrown
ID: 26294305
Thank you. That's very helpful.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question