Registered on the site

<meta name="viewport" content="width=1000"> 

How to make the site adaptive with a resolution of less than 768 px? So that when the resolution is less than 768 px

 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 

    1 answer 1

    When you first load the site, and when the window is resized, check the width of the browser window, and change the contents of your existing meta tag:

     $(document).ready(function() { var reinitMeta = function() { if ($(window).width() < 768) { $('meta[name="viewport"]').attr('content', 'width=device-width, initial-scale=1.0'); } else { $('meta[name="viewport"]').attr('content', 'width=1000'); } }; reinitMeta(); $(window).resize(reinitMeta); });