1
I have a website, and I’m working on responsiveness on it. I have a mobile version, similar to a web app, in a specific directory within the project. Currently when the screen resolution is less than 768px, it automatically redirects to the mobile site. Until then perfect, but when I reduce the browser window it does not redirect unless I update the page, because what it redirects is a Jquery script that checks when the page is loaded what the resolution is.
The problem is that I need to check all the time so that I can redirect when the screen is smaller and already rendered. I thought about putting a media query for resolutions at least 768 wide, but I couldn’t find how to redirect from css itself, or call some script when this query is activated.
Also accepted as a solution some Jquery event triggered when the width is
Because it does not check with the event
resize
ofjquery
? Puts the function inside it and whenever there is a change in window size the event will be called.– Jorge.M
Can you give me an example of this event?
– Matheus Mendes