如何使Foundation工具提示集中显示?

问题描述:

这就是我在做什么.

<input  data-tooltip  data-width="350" class="has-tip tip-left" title="enter name" type="text" />
<script>
$(document).foundation();

工具提示在将鼠标悬停在输入上时工作正常,但我想将其称为焦点. 请帮忙?

tooltip is working fine on hover to input but i want to call it on focus. please help?

$(".has-tip").focus(function(){
  $(this).foundation();
});

但是请确保您可能想隐藏焦点上的工具提示.为此,您可以这样做

But make sure, you may want to hide the tooltip on focus out. for that you may do this

$(".has-tip").blur(function(){

//may be you can hide the tooltip or call the hide function if any.
});

请注意,呼叫事件可能会根据jquery的版本而变化.

Note, calling events may change according to the jquery version.