If statement for jquery
How to make th开发者_开发技巧is 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.
$(this).click(function() {
if ( ( showLarge == 1 ) && ( showLarge != $('.loginLarge_wrap' ) ) ) {
//
}
});
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')))
精彩评论