Can someone tell me if these is valid, essentially I want the script to 'do nothing' if these two conditions are not met? Do I need the 'else' that should usually follow? if(detector.width()<=420 && detector.width()>300) { } else if(detector.width()<=300) { } Code (markup): Thanks!
no. you dont need the 'else'. the script run from top. first check is the first if condition met. if met do in the bracket. if not. check the second if. if the condition meet do in the bracket. if no condition met. the script will do nothing.