【问题标题】:JQuery Tools: How to populate title tag from another JS file text stringJQuery 工具:如何从另一个 JS 文件文本字符串填充标题标签
【发布时间】:2012-10-24 21:22:06
【问题描述】:

我正在为工具提示使用 JQuery Tools 插件,它工作正常,但我想从另一个 JS 文件加载我的工具提示文本字符串,或者如何从另一个 JS 文件文本字符串填充标题标签。这是我的代码:

$(".show-tooltip-top[title]").tooltip({position: "top center"});

以前我只是用 JQuery 做这样的事情,而不是插件:

$(".tooltip-test",this).html("This is a tooltip test");

【问题讨论】:

  • 您查看问题的答案,然后单击对您帮助最大的答案旁边的空白复选标记。
  • @RustyJeans 非常感谢!

标签: javascript jquery jquery-plugins jquery-tools


【解决方案1】:

不清楚你在问什么,但如果你只是想知道如何改变元素的title属性,你可以使用jQuery's attr function

$(".show-tooltip-top[title]").attr("title", "your title text goes here").tooltip({position: "top center"});

【讨论】:

    猜你喜欢
    • 2019-10-23
    • 2022-11-29
    • 1970-01-01
    • 1970-01-01
    • 2020-03-14
    • 2021-09-04
    • 2014-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多