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?

有帮助吗?

解决方案

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 %>"}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top