/    Sign up×
Community /Pin to ProfileBookmark

change 2 pictures with OnMouseOver

Hello,

i am trying to write a script tha changes 2 different pictures when i position the mouse over one of them, wich is a link to another page.

i found a script that changes a picture when you point at it and i modyfied it. Now when i point at the picture that is a link, the other one change exactly as i want but the one taht i point at doesn’t chage and i don’t know how to make it.

Please help.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@chrizSep 21.2004 — something like this?


<img src="image1.gif" name="img1">

<br>

<img src="image2.gif" name="img2">

<a href="URL" onMouseover="in()" onMouseout="out()">THE LINK</a>

<script language="javascript">

function in(){

document.img1.src = "image3.gif";

document.img2.src = "image4.gif";

}

function out(){

document.img1.src = "image1.gif";

document.img2.src = "image2.gif";

}

</script>


Make sure you change th eimage URLs to the images you have on ur site
Copy linkTweet thisAlerts:
@vinnihauthorSep 21.2004 — Thank you very much Chriz.

I still can't make it work, but i'll keep trying till it is done.

Thank you again.
×

Success!

Help @vinnih 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.20,
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,
)...