How to redirect to screen size using JQUERY?

  • 0
    How to use JQUERY to redirect in real time if the screen size is less than 1200 px?
    JavaScript Anonymous, Nov 28, 2019

  • 1 Answers
  • 0
    $(document).ready(function() {

    $(window).resize(function() {
    if ($(window).width() <= '1200'){
    $(location).attr('href', 'https://www.google.com/')
    }
    });

    });
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!