Delay improvement

Thildemar's Avatar

Thildemar

04 May, 2010 09:30 PM

Thanks for a great plugin!

While developing a new site I noticed that an animation fired by a focus event was causing TipTip to render using the position of an element during the animation instead of at its end. I figured adding some delay to the tooltip would fix this, but it seems the current implementation of delay fires after element position has been recorded. The quick and dirty fix I found is to move the setTimeout code into the trigger function like so:
... else if(opts.activation == "focus"){

      org_elem.focus(function(){
                    if (timeout){ clearTimeout(timeout); }
                    timeout = setTimeout(function(){active_tiptip();}, opts.delay);
                })

... and leaving just "tiptip_holder.stop(true,true).fadeIn(opts.fadeIn);" at the bottom of the active_tiptip() function where the setTimeout used to be.

As fare as I can tell this does not alter any of the functionality other than allowing all positioning calls to be made after the delay. Maybe a more streamlined version of this could find its way into the next version.

Thanks again!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac