JQuery combines td: not (: first-child) and td: empty

I am trying to combine in jQuery the code td: not (: first-child) and td: empty. I have attached the code excerpt below. This code uses the hoverIntent plugin to execute the function code after a time delay of 1 second.

$(".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); }); }); 

In simple terms, I need a function to run if the mouse is not above the first column in my table (this table contains cells whose contents are not related to my tooltip) and the cell above which the mouse is not empty. I am not sure whether to use td: empty or use use.html ().

I tried the following which did not work:

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

I see ideas for using .is (: empty) and filter () related to other issues, but I don't see how I can apply this to this situation.

I would appreciate any help!

+4
source share
1 answer

td:empty selects cells that are empty, which contradicts the description in your question that says you want it to apply only to cells that are not empty.

From your description, it looks like your last selector should work:

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

If it is not, then something else is wrong.

+6
source

Source: https://habr.com/ru/post/1433014/


All Articles