What is the logic of jquery window.width?

I have created a signup form and whenever I click my input field, a modal has to open responsively. It's okey here on mobile it work's the way I want but if I resize my window nothing happens so I want to give you some example