【发布时间】:2015-09-21 08:59:47
【问题描述】:
我尝试了以下代码,
<input type="file" name="file" id="fileField" data-toggle="tooltip" data-placement="bottom"/>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
它执行后我得到了这个,
<input id="fileField" type="file" data-placement="bottom" data-toggle="tooltip" name="file" data-original-title="" title="">
通常我们添加一个标题属性来获得一个简单的工具提示。但在下面的示例中,我们得到了一个没有标题属性的简单工具提示。每当我们选择不同的文件时,它都会更新。我需要这些工具提示作为引导工具提示,并且每当我通过“选择文件”按钮选择不同的文件时都需要更新。 http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_file
【问题讨论】:
-
您是否尝试阅读 Bootstrap 文档?
-
是的,试过了。但问题是这些文件类型输入字段没有使用 Bootstrap FileStyle (markusslima.github.io/bootstrap-filestyle) 重新命名。我现在不允许改变它。需要找到解决方法来解决此问题。谢谢。
-
它们是否有样式并不重要,它只是一个
input元素。遵循文档,它将起作用。 -
@anshu,使用
bootstrap-filestyle可以使用简单的input标签,只需确保在脚本中也包含bootstrap-filestyle库 -
可能是我问问题的方式有点令人困惑。所以我稍微改了一下。谢谢
标签: javascript jquery html twitter-bootstrap twitter-bootstrap-tooltip