I have divs with class "someclass"; each div 开发者_开发知识库has child divs with class "otherclass".
I need to check if the divs with "otherclass" are display:none and then fadeout the parent with "someclass"
How can I do it every time I click on some checkbox on the page?
$(':checkbox').click(function(){
  if( $('.otherclass').css('display')=='none' ){
    $('.otherclass').parent().fadeOut('normal');
  }
}
This is assuming .otherclass is a unique identifier. Also, if you want to to link these elements to the checkbox that is clicked with, say, the same class it's a little more involved.
$(':checkbox').click(function(){
  var el = $(this).attr('class'); //Better to use a unique ID here
  if( $('div.' + el).css('display')=='none' ){
    $('div.' + el).parent().fadeOut('normal');
  }
}
$(":checkbox").click(function() {
    if(!$(".otherclass:visible").length)
        $(".someclass").fadeOut();
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论