I want to do something like this in JQuery
开发者_如何学Pythonif($(this).width() < 400px){
//do something
}
But it didnt work like that....mhm how is it correct?
width()
returns a plain number, and even if not your code would have an undefined symbol since 400px
is not in quotes - instead use it like this:
if($(this).width() < 400){
//do something
}
精彩评论