获取不显示的元素计数

时间:2018-01-29 21:58:10

标签: jquery loops count

我有一张带tr的表,其中很多是'display:none' 我想要实现的是获得一些可见的表。 我的代码如下:

public class LinkedList {
    static class Node {
        public Node() { }
        public double item;
        public Node next;
    }

    int N;
    Node first;

    public LinkedList () {
        first = null;
        N = 0;

    public void delete (int k) {
        if (k == 0) {
            first = first.next;
            N--;
        }

        else {
            Node n = first;
            for (int i = 0; i < k-1; i++) {
                n = n.next;
            }
            n.next = n.next.next;
            N--;
        }
    }

    public void add (double item) {
        Node newfirst = new Node ();
        newfirst.item = item;
        newfirst.next = first;
        first = newfirst;
        N++;
    }

    private static void testDelete () {
        MyLinked b = new MyLinked ();
        b.add (1);
        print ("singleton", b);
        b.delete (0);
        print ("deleted", b);
        for (double i = 1; i < 13; i++) {
            b.add (i);
        }
        print ("bigger list", b);
        b.delete (0);
        print ("deleted at beginning", b);
        b.delete (10);
        print ("deleted at end", b);
        b.delete (4);
        print ("deleted in middle", b);
    }

    public static void main (String args[]) {    
        testDelete();
    }

}

1 个答案:

答案 0 :(得分:0)

在目标部分使用JQuery的Visible选择器:

  

jQuery(&#34;:visible&#34;)

以下是文档https://api.jquery.com/visible-selector/

虽然不能提出评论中提到的任何具体解决方案,但要获得确切答案,请发布最低限度的工作代码。