如何使Foundation工具提示集中显示? [英] How can i make Foundation tooltip show on focus?

查看:92
本文介绍了如何使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.

这篇关于如何使Foundation工具提示集中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆