/    Sign up×
Community /Pin to ProfileBookmark

Mouseover Image – Text appears somwhere else in the page

Hello everyone

I will try and explain this simply!!!!

I have a gallary of pictures on a page. when i hover over a picture i have set the alt text to be description…..thats fine

but.. i dont want to use the alt text. I want to hover over the picture and somewhere else on a page it displays the description, this could be text or an image.

so every picture when hovered over will show the description in the same place.

I hope someone can help

Regards

Melvyn
? ? 😡 😡

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@SelrachFeb 23.2006 — Here is something to get you started.

[CODE]
<script type="text/javascript">
function showDescription(text){
document.getElementById('information').innerHTML = text;
}

function clearDescription(){
document.getElementById('information').innerHTML = '';
}
</script>
<img src="/img1.jpg" onmouseover="showDescription('This is the text for the description, it can be whatever.')" onmouseout="clearDescription();"/>

<img src="/img2.jpg" onmouseover="showDescription('This is another description, it can also be whatever.')" onmouseout="clearDescription();"/>

<div id="information"></div>
[/CODE]
×

Success!

Help @tadpole2frog 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...