Below, I put in a sample code, the whole trick is that when the screen is narrowed, the code changes, but if I choose a mobile device whose width is less than that specified in the condition, then nothing happens.
function SCREENmove() { width = document.documentElement.clientWidth; height = document.documentElement.clientHeight; if (width > 799) { $('.node').addClass("response") } else { $('.node').removeClass("response") } } $(window).resize(SCREENmove); $(document).ready(SCREENmove); .node { width: 100%; height: 50px; display: block; position: relative; background: #CDDC39; } .node.response { background: #FF9800; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <div class="node"></div> 

<div class="node"></div>. - Dmitriy Kondratiuk