jeudi 29 août 2019

JQuery not closing brackets properly (problem with closing if tag) [on hold]

I am having a hard time understanding why my code isn't working. The brackets are not closing properly though they should.

$(document).ready(function(){  
    if(!($("#drop-industries").is(":hover"))){
        if(!($("#hover-industries").is(":hover")){
            $("#drop-industries").hide();
        }
           }            //this should close the first if bracket but it is not
});                     //this is closing it instead 

Note that I first had an && to check for both conditions together, but it wasn't working either (now I see it probably wasn't the &&), but anyway, here is the code if you'd like to see that instead:

$(document).ready(function(){  
    if(!($("#drop-industries").is(":hover")) && !($("#hover-industries").is(":hover"))){
    $("#drop-industries").hide();
}
});

I've tried several ways of closing the brackets, etc, but it's not working. Is it that I am probably using ! improperly? Any help is appreciated.

Aucun commentaire:

Enregistrer un commentaire