2012-02-20 73 views
0

我正在使用twitter boostrap(twipsy)來實現我的web應用程序的工具提示。我想在工具提示顯示中添加延遲(例如2秒後)。如何實現延遲顯示twipsy工具提示

我實現如下(見延遲)

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

然而,工具提示仍然會立即顯示,當鼠標懸停我的頭像。

任何關於如何實現工具提示顯示延遲的建議?

回答

1

試試這個:

%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 %>"} 

或者,如果您也想爲隱藏延遲:

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