Search code examples
backbone.jstooltiphamldelaytwitter-bootstrap

How to implement delay in showing twipsy tooltip


I am using twitter boostrap (twipsy) to implement tooltip for my web app. I want to add a delay in the tooltip display (say after 2 seconds).

My implementation is as follows (see delay)

%li.friend
  %a{:href=>"#!/<%=nick%>/<%=question_slug%>", :rel=>"twipsy", :title=>"<%=nick%>&#39;s answers for this question", :delay=> {show:2000}}
    %img{src: "<%= avatar_url %>"}

However, the tooltip still shows up immediately when I mouseover on the avatar.

Any advice on how I can implement the delay in display for the tooltip?


Solution

  • Try this :

    %li.friend
      %a{:href=>"#!/<%=nick%>/<%=question_slug%>", :rel=>"twipsy", :title=>"<%=nick%>&#39;s answers for this question", :delay=> {show:2000, hide: 0}}
        %img{src: "<%= avatar_url %>"}
    

    Or if you also want a delay for hide :

    %li.friend
      %a{:href=>"#!/<%=nick%>/<%=question_slug%>", :rel=>"twipsy", :title=>"<%=nick%>&#39;s answers for this question", :delay=> 2000}
        %img{src: "<%= avatar_url %>"}