/    Sign up×
Community /Pin to ProfileBookmark

Pop up images help!

Hi, I’m trying to design a simple website. The site is located here: [url]www.lashextensions.ie/testing.htm[/url] The problem I’m having is that I want two images to pop-up when the user clicks another image.

Here is the problematic code:

[code]
<img src = “images/clients.gif” onclick = “showClient()” class = “moveclients”/>
<img src = “images/training.gif” onclick = “showClient()” class = “movetraining”/>
<br/>
<script type=”text/javascript”>
var x = 0;
function showClient(){
x = 1;
}
if (x == 1){
document.write(“<img src = “images/java.gif” class = “movejava”/>n<img src = “images/nojava.gif” class = “movenojava”/>”);
}
</script>
[/code]

I know this is wrong but could someone give me correct code? I’m only a newbie in JavaScript but I have coded in languages such as Java and C++

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @javaherd spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...