I want to have a jquery function that runs if the width of my div (.slider) is between 650px and 521px. I have this so far for code which isn't working and I am unsure of how to write the greater than less than part:
} else if ($(".slider").css("width") < "651px" || > "520px") {
I am getting this error in the console: Uncaught SyntaxError: Unexpected token >
*******UPDATE***** I am now using:
var w = parseFloat($('.slider').css('width'))
if (w > 651) {
//do something here
} else if (w < 651 || w > 520) {
//do something here
} else if (w <= 520) {
//do something here
} else {
//do something here
}
but for some reason it is stuck at the 'else if (w < 651 || w > 521)' conditional so when my div is less than 520 in width it is still firing what's inside that conditional.