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
}
if(!($(this).hasClass('agallery') || $(this).hasClass('aslide'))){
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With