Click to See Complete Forum and Search --> : floating imagas....


Richei
11-29-2002, 08:23 PM
Is it possible to have a couple of images [same image, just two of the same] float around a link when the mouse moves over it? or does it have to be done with java or flash ?

If it is, could someone do a quick script for me?

Paco Zarabozo
11-30-2002, 04:44 AM
Here's a quick script:

<html>

<body onMouseMove="moveImg()">

<a href="javascript:void(0)" onMouseOver="showImg(true)" onMouseOut="showImg(false)">This is a link</a>


<div id="myimg" style="Position : Absolute ; Visibility : Hidden" vpignore="true">
<img src="x.gif" border="0">
</div>

<script>
on = false;
function showImg(value) {
on = value;
d = document.all.myimg;
value ? d.style.visibility="Visible" : d.style.visibility="Hidden";
}

function moveImg() {
mx = window.event.clientX;
my = window.event.clientY;
if (on) {
document.all.myimg.style.pixelLeft = (mx + 10);
document.all.myimg.style.pixelTop = (my + 10);
}
}
</script>

</body>
</html>

I hope it works (didn't test it).

Paco.

Richei
11-30-2002, 10:11 AM
this one sort of works too. It does show the picture but only in the upper left hand corner. I need to it revolve around the link.

basically, when the mouse moves over the link, it will show a picture moving around the link.

Paco Zarabozo
11-30-2002, 10:48 AM
Nope. The script i wrote for you doesn't show only in one corner. It follows the mouse, no matter where the link is.

So, do you need a script to make an image move arround the link? like in circles or rounding link? I'm sorry, there's no simple way to do that (nor quick!). It requires a lot of time and a very good level of programming knowledge. I think i could do it, but it requires a lot of time, so i wont.

Sorry. :-)

Paco.

Richei
11-30-2002, 10:50 AM
that i can understand :) it doesn't follow the mouse though. it just sticks in the corner.

Paco Zarabozo
11-30-2002, 02:37 PM
What browser are you using. and what version?

Richei
11-30-2002, 02:38 PM
My browser, IE v6.0.2800.1106