There is html that is formed once when the page is loaded, then changes are made by the same js , and at a certain resolution, you must reset the entire generated html , resize event.
The essence of the question, how to run the script once?
function obnovitStranicu() { if ($(window).width() < 470) { location.reload(); } } $(window).resize(function() { obnovitStranicu(); });
resizeevent handler, but write it as a function separately and, when necessary, simply call it. - VostokSisterslocalStorage- Vasily Barbashev