我的 asp.net 页面中有 jQuery qtip() 函数,我需要从单击的项目中获取 id。有谁知道怎么做吗?
作为示例,请在下面找到我的脚本代码...
$("#content a.toolTip").qtip({
content: { url: 'PageView.aspx?Param=' + '---get id---' }
)};
提前致谢。
[]'RPG
最佳答案
如果您想在设置 qtip 时通过 this
引用该元素,您可以在 .each()
内进行设置。这样 this
引用当前元素。
$("#content a.toolTip").each(function() {
// Now "this" is a reference to the
// element getting the qtip
// Get the ID attribte -------------------------------v
$(this).qtip({ content: { url: 'PageView.aspx?Param=' + this.id } });
});
关于jQuery qtip() - 如何从单击的项目中获取 id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3480383/