Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Event delay

Expand Messages
  • dav.glass@yahoo.com
    You can still use setTimeout, just change your logic.. showHover = false; On mouseover: if (!showHover) { run Animation; set a var called showHover = true; }
    Message 1 of 2 , Jul 28, 2006
    • 0 Attachment
      You can still use setTimeout, just change your logic..

      showHover = false;

      On mouseover:
          if (!showHover)  {
                 run Animation;
                 set a var called showHover = true;
          }
          check to see if the timeout var is there, if it is clearTimeout(timoutVar)

      then on mouseout set the timeout
          set a var for the timeout call,  

      in the timeout function:
          clearTimout;
          showHover = false;
         

      Something along those lines should give you the desired effect..

      Basically, you need to check if the hover is shown before showing it..
       
      Dav Glass
      dav.glass@...
      davglass.com
      618.694.3476

      + Windows: n. - The most successful computer virus, ever. +
      + A computer without a Microsoft operating system is like a dog
      without bricks tied to its head +
      + A Microsoft Certified Systems Engineer is to computing what a
      McDonalds Certified Food Specialist is to fine cuisine +


      ----- Original Message ----
      From: Michael Soule <mikesoule@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Friday, July 28, 2006 11:19:02 AM
      Subject: [ydn-javascript] Event delay

      Does anyone know of a way to delay an event be it YUI or otherwise.
      Before you suggest setTimeout() , think carefully about the problem.

      I have a div that appears onmouseover of the containing table cell. I
      want that div to disappear 1.5 seconds after mouseout on the
      table-cell. However, if I mouse out and return to the cell in less
      than 1.5 seconds, I want the div to remain visible without flickering
      on and off.

      Any help is much appreciated.

      mike


    Your message has been successfully submitted and would be delivered to recipients shortly.