Scriptaculous onmouseover event fire delay

jon23d
jon23d used Ask the Experts™
on
I am using scriptaculous to cause images in a menu to grow then shrink again.  There are several images arranged in a vertical column.  I use the following functions, which are called for the events onmouseover and onmouseout:

function popIn(item) {
      new Effect.Scale(item, 64, {scaleFromCenter:true, duration: .1, queue:'end'});
}
           
function popOut(item) {
      new Effect.Scale(item, 150, {scaleFromCenter:true, duration: .1, queue:'end'});
}

When a user starts at the top and moves towards the bottom every image pops out and then in before the image we are looking for...  I want to make it so that prior to actually popping out that the user is required to keep their mouse hovering over the image for a specified amount of time.

The image's code looks like this:

<img src=th_img_74.jpg'  onmouseover = "popOut(this);" onmouseout="popIn(this);" />

The actual url is http://www.sscautos.com/dev/photos.php.  Any ideas?  Does this make sense?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Expert
Top Expert 2009
Commented:
Perhaps (not tested)

<script>
popOutTId = "";
popInTId = "";
item = null;
function popIn() {
      if (item) new Effect.Scale(item, 64, {scaleFromCenter:true, duration: .1, queue:'end'});
}
           
function popOut() {
      if (item) new Effect.Scale(item, 150, {scaleFromCenter:true, duration: .1, queue:'end'});
}
function doPopOut(theItem) {
  clearTimeout(popInTId)
  item = theItem;
  popOutTId = setTimeout('popOut()',500)
}
function doPopIn(theItem) {
  clearTimeout(popOutTId)
  item = theItem;
  popInTId = setTimeout('popIn()',500)
}

</script>
<img src=th_img_74.jpg'  
onmouseover = "doPopOut(this);" onmouseout="doPopIn(this);" />
Forced accept.

Computer101
EE Admin

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial