Reputation: 1791
How to make this right?
$(this).click(function(){
if(showLarge == 1 && !$('.loginLarge_wrap')){
//
}
});
The idea here is that, there's a condition showLarge equals to 1 and not equals to .loginLarge_wrap
Thank you.
Upvotes: 0
Views: 85
Reputation: 1445
You can use jQuery method - hasClass() to check to see if the class - '.loginLarge_wrap' is present instead of doing
showLarge != $('.loginLarge_wrap' )
Assuming showLarge is a DOM element. you can do something like this:
if($(showLarge).val() == 1 && (!$(showLarge).hasClass('.loginLarge_wrap')))
Upvotes: 0
Reputation: 11414
$(this).click(function() {
if ( ( showLarge == 1 ) && ( showLarge != $('.loginLarge_wrap' ) ) ) {
//
}
});
Upvotes: 3