jQuery结合td:not(:first-child)和td:empty

我正在尝试在我的jQuery代码中组合td:not(:first-child)和td:empty selectors.我在下面附上了一段代码摘录.此代码使用hoverIntent插件在1秒的时间延迟后执行功能代码.

$(".jqgrow td:not(:first-child)")
    .mouseenter(function(){
    $.doTimeout('cellhover',1000,function(e){
        my_tooltip
        .css({opacity:0.85,display:"none"})
        .stop() // Added stop() to fix bug,flickering of tooltip
        .fadeIn(10);                                
    });
});

简单来说,如果鼠标不在我表中的第一列(此表包含其内容与我的工具提示无关的单元格),并且鼠标所在的单元格不为空,我需要触发该函数.我不确定是否使用td:empty或使用.html().

我尝试了以下没有奏效的方法

$(".jqgrow td:not(:first-child) td:empty")
$(".jqgrow td:empty td:not(:first-child)")
$(".jqgrow td:not(:first-child,:empty)")

我看到使用.is(:empty)和filter()与其他问题相关的想法,但我不知道如何将其应用于这种情况.

我会感激任何帮助!

解决方法

td:empty选择空的单元格,这与您的问题中的描述相反,后者声明您希望它仅应用于非空单元格.

根据您的描述,看起来您的上一个选择器应该工作:

// Select td elements in .jqgrow that are neither :first-child nor :empty
$(".jqgrow td:not(:first-child,:empty)")

如果没有,那就别错了.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...