/    Sign up×
Community /Pin to ProfileBookmark

mouseover and foto

With the script below, the foto appears in the left upper corner from the sreen and disappear when I scrolling down, and not on the place where the mouse goes over: here Name.
What I have to change?


———————————————————————————-

<style type=”text/css”>
#plaatje {
position:absolute;
z-index:1000;
visibility:hidden; }
</style>

<script type=”text/javascript”>
function init() {
if (window.Event) {document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = haalMuisPositie; }

function haalMuisPositie(e) {
muisX = (window.Event) ? e.pageX : event.clientX;
muisY = (window.Event) ? e.pageY : event.clientY; }
<head>
function toonPlaatje(naam,beeldje) {
laag = document.getElementById(naam);
laag.innerHTML = ‘<img src=’ +beeldje+’>’;
laag.style.visibility = “visible”;
laag.style.top = muisY + “px”;
laag.style.left = muisX + “px”;
plaatsPlaatje() }

function verbergPlaatje(naam){
laag = document.getElementById(naam);
laag.style.visibility = “hidden”; }

function plaatsPlaatje() {
laag.style.top = muisY + “px”;
laag.style.left = muisX + “px”; }
</script>
</head>

<body onload=”init()”>

<div id=”plaatje”></div>

<table >

<tr>
<td><a onmouseover=”toonPlaatje(‘plaatje’,’foto.JPG’);” onmouseout=”verbergPlaatje(‘plaatje’);”>Name</a></td>
</tr>
</table>
</body>
etc.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @koedijk 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.18,
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,
)...