我用这段代码来显示标题
$(".line").mopTip({
'w':150,
'style':"overOut",
'get': $(this).attr("title")
});
Run Code Online (Sandbox Code Playgroud)
但作为标题,我得到了页面的标题......我错了什么?
您正在使用this
的内部文档窗口范围,这就是为什么它返回文档标题.要获得每一行的标题,您必须遍历每一行.
$(".line").each(function(){
//inside the each the scope of this refers to the current line
$(this).mopTip({
'w':150,
'style':"overOut",
'get': $(this).attr("title")
});
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
221 次 |
最近记录: |