Jquery if element (': visible') [closed]

0

I'm trying to create an if so if one div is visible, another disappears (in a wordpress template):

    jQuery(document).ready(function($){
       if($('.classe1').is(':visible'){
           $('.classe2').hide();
       }
});

But you are not being recognized, what can I do?

    
asked by anonymous 13.01.2016 / 15:50

1 answer

2

missing the last ) in if if($('.classe1').is(':visible')...

$(document).ready(function($) { 
    if($('.classe1').is(':visible')) {
        $('.classe2').hide();
    }
});
    
13.01.2016 / 15:57