I
I
iAndyPC2020-05-07 13:55:26
HTML
iAndyPC, 2020-05-07 13:55:26

How to update an element when moving from mobile to desktop?

How to update a div when moving from mobile screen width to desktop. By "refresh" I mean what happens after clicking the refresh button in the browser. Is there a way to do this with media queries?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
origami1024, 2020-05-07
@origami1024

The simplest thing is to hang the handler on the onresize of the window And there already "update" or bring the necessary elements to the desired state A more detailed example https://habr.com/en/post/166321/
window.addEventListener("resize", myFunction);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question