The conditional should be met only if the clicked element has no class agallery or aslide. This is not working for me.
if(!$(this).hasClass('agallery') || !$(this).hasClass('aslide')){
//do certain things
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically, you should read this as “not (either A or B)”, while Clive’s equivalent is “(not A) and (not B)”.
Your condition “(not A) or (not B)” is true if it doesn’t have one. So it will only be false if it has both classes.