Is it possible to make an element invisible to jquery

This question already has an answer here:

  • Detect if an element is visible [duplicate] 3 answers

  • Use :visible selector to select element which are not hidden.

    $('.class:visible')
    

    Note: (from docs)

    Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero.

    Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout.


    在jQuery中有一个:visible选择器(和a :not()选择器,.ie :not(:visible)


    Since you have two elements, you must iterate trough them and find the hidden one. I see this process convincing for me:

    $('.class_el').each(function(el){
          if(el.hidden)
            //do something
    });
    链接地址: http://www.djcxy.com/p/83536.html

    上一篇: 到达div(或图像)时开始CSS转换

    下一篇: 是否有可能让元素对jquery不可见?