Hi all,

This is my first scriptaculous venture, and I am trying to apply
Effect.Move with a sinoidal transition to a div when someone mouses
over a link. I also apply Effect.Move to the same div (but in the
opposite direction, I thought) when someone mouses out of that same
link.
So, basically, what I want is when you mouseover a link, another
information div appears and floats up, and when you mouseout, the div
just needs to disappear (it doesn't even have to float back down).

The problem is, that when you mouseout and mouse back over the same
link really quickly, it remembers where the div was the previous
mouseover and continues on from that point. It's as if the div never
gets a chance to reset to its original position, because the user is
mousing on and off of the link so fast, and this makes the div just
keep "climbing" up the page.

Here is the code that contains the link:
<div class="siteLink"><a href="http://www.mysite.com"; target="_blank"
onmouseover="previewOn('divSite1');" onmouseout="previewOff
('divSite1');">1</a></div>

Here is the Javascript code that I have in the head of my document:
<script language="javascript">
function previewOn(thisDiv) {
        document.getElementById(thisDiv).style.display = "inline";
        new Effect.Move(thisDiv, {
           x: 0, y: -10, mode: 'relative',
           transition: Effect.Transitions.sinoidal,
           duration: .3
        });
}

function previewOff(thisDiv) {
        new Effect.Move(thisDiv, {
           x: 0, y: 10, mode: 'relative',
           transition: Effect.Transitions.sinoidal,
           duration: .0,
           afterFinish: function() {
        document.getElementById(thisDiv).style.display = "none";
       }
        });
}
</script>

I have tried setting the duration of the mouseout to .0, but this
still does not get the div "back into place" in enough time.

Any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to